File tree Expand file tree Collapse file tree 1 file changed +5
-12
lines changed
Expand file tree Collapse file tree 1 file changed +5
-12
lines changed Original file line number Diff line number Diff line change @@ -48,9 +48,7 @@ def fixture_example_directory(
4848def fixture_example_runner (
4949 request : pytest .FixtureRequest , typer_runner : CliRunner , tmp_path : Path
5050) -> Generator [CliRunner ]:
51- """TODO"""
52- prev_cwd = os .getcwd ()
53-
51+ """Sets up an isolated filesystem for an example test."""
5452 # Get the root directory of the project
5553 root_directory = Path (__file__ ).parent .parent .parent .absolute ()
5654
@@ -63,13 +61,8 @@ def fixture_example_runner(
6361 # Generate the example path from the pytest file and test name
6462 example_path = root_directory / 'examples' / file_name / test_name
6563
66- try :
67- with typer_runner .isolated_filesystem (tmp_path ) as temp_directory :
68- os .chdir (temp_directory )
69-
70- # Copy the example directory to the temporary directory
71- shutil .copytree (example_path , Path (), dirs_exist_ok = True )
64+ with typer_runner .isolated_filesystem (temp_dir = tmp_path ):
65+ # Copy the example directory to the temporary directory
66+ shutil .copytree (example_path , Path (), dirs_exist_ok = True )
7267
73- yield typer_runner
74- finally :
75- os .chdir (prev_cwd )
68+ yield typer_runner
You can’t perform that action at this time.
0 commit comments