()
| 10 | |
| 11 | @pytest.fixture |
| 12 | def temp_tree(): |
| 13 | root_dir = tempfile.mkdtemp() |
| 14 | |
| 15 | create_file(os.path.join(root_dir, "file1.txt"), "Hello, world!") |
| 16 | create_file(os.path.join(root_dir, "file2.txt"), "Another file") |
| 17 | os.mkdir(os.path.join(root_dir, "empty_dir")) |
| 18 | nested_dir = os.path.join(root_dir, "nested_dir") |
| 19 | os.mkdir(nested_dir) |
| 20 | create_file(os.path.join(nested_dir, "nested_file.txt"), "Nested content") |
| 21 | |
| 22 | yield root_dir |
| 23 | |
| 24 | shutil.rmtree(root_dir) |
| 25 | |
| 26 | |
| 27 | def create_file(path, content): |
nothing calls this directly
no test coverage detected