Directory fixtures
provide.testkit.file.directory_fixtures
¶
Directory-specific test fixtures.
Fixtures for creating temporary directories, nested structures, and standard test directory layouts.
Functions¶
empty_directory
¶
nested_directory_structure
¶
Create a deeply nested directory structure for testing.
Creates
- level1/
- level2/
- level3/
- deep_file.txt
- level3/
- file_l2.txt
- level2/
- file_l1.txt
Yields:
| Type | Description |
|---|---|
Path
|
Path to the root of the structure. |
Source code in provide/testkit/file/directory_fixtures.py
temp_directory
¶
Create a temporary directory that's cleaned up after test.
Yields:
| Type | Description |
|---|---|
Path
|
Path to the temporary directory. |
Source code in provide/testkit/file/directory_fixtures.py
test_files_structure
¶
Create standard test file structure with files and subdirectories.
Creates
- source/
- file1.txt (contains "Content 1")
- file2.txt (contains "Content 2")
- subdir/
- file3.txt (contains "Content 3")
Yields:
| Type | Description |
|---|---|
tuple[Path, Path]
|
Tuple of (temp_path, source_path) |