Skip to content

Commit 207aef9

Browse files
committed
change dir in fixture with cleanup
1 parent 8a57d3a commit 207aef9

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

tests/integration/test_typing.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,18 @@ def expect(status=None, outputs=None, modular=False):
111111
return data
112112

113113

114+
@pytest.fixture()
115+
def change_dir():
116+
original_dir = os.getcwd()
117+
118+
def change(dirname):
119+
os.chdir(dirname)
120+
121+
yield change
122+
123+
os.chdir(original_dir)
124+
125+
114126
@pytest.mark.parametrize(
115127
"arguments, assertions",
116128
[
@@ -337,7 +349,7 @@ def test_typi001_component_typing(arguments, assertions, tmp_path):
337349
],
338350
)
339351
def test_typi002_typing_compliance(
340-
typing_module, prelayout, layout, callback_return, assertions, tmp_path
352+
typing_module, prelayout, layout, callback_return, assertions, tmp_path, change_dir
341353
):
342354
codefile = os.path.join(tmp_path, "code.py")
343355
os.chdir(tmp_path)

0 commit comments

Comments
 (0)