File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
309296def 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
315301def 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 )
You can’t perform that action at this time.
0 commit comments