def test_dir_structure(test_file_tree_dir, test_file_tree_nodes):
    """
    Stage a temporary directory structure full of files so we can delete some of them
    """

    for path, content in test_file_tree_nodes:
        if content:
            path.write_text(content)
        else:
            path.mkdir(parents=True, exist_ok=True)

    cwd = Path.cwd()
    os.chdir(test_file_tree_dir)

    try:
        yield test_file_tree_dir
    finally:
        os.chdir(cwd)

    Stage a temporary directory structure full of files so we can delete some of them
    
tests/test_scripts.py