Skip to content

Commit 0f17918

Browse files
committed
corrections
1 parent 35aed66 commit 0f17918

1 file changed

Lines changed: 3 additions & 17 deletions

File tree

tests/conftest.py

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -291,29 +291,15 @@ def with_test_cache(test_files_directory, request):
291291
shutil.rmtree(tmp_cache)
292292

293293

294-
def find_test_files_dir(start_path: Path, max_levels: int = 1) -> Path:
295-
"""
296-
Starting from start_path, climb up to max_levels parents looking for 'files' directory.
297-
Returns the Path to the 'files' directory if found.
298-
Raises FileNotFoundError if not found within max_levels parents.
299-
"""
300-
current = start_path.resolve()
301-
for _ in range(max_levels):
302-
candidate = current / "files"
303-
if candidate.is_dir():
304-
return candidate
305-
current = current.parent
306-
raise FileNotFoundError(f"Cannot find 'files' directory within {max_levels} levels up from {start_path}")
307294

308295
@pytest.fixture
309296
def static_cache_dir():
310-
311-
start_path = Path(__file__).parent
312-
return find_test_files_dir(start_path)
297+
298+
return Path(__file__).parent / "files"
313299

314300
@pytest.fixture
315301
def workdir(tmp_path):
316-
original_cwd = os.getcwd()
302+
original_cwd = Path.cwd()
317303
os.chdir(tmp_path)
318304
yield tmp_path
319305
os.chdir(original_cwd)

0 commit comments

Comments
 (0)