Skip to content

Commit 7f92f63

Browse files
committed
un-chdir R test
1 parent 7f3713b commit 7f92f63

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

nipype/interfaces/tests/test_r.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def test_cmdline(tmp_path):
2828

2929
@pytest.mark.skipif(no_r, reason="R is not available")
3030
def test_run_interface(tmpdir):
31-
os.chdir(tmpdir)
31+
cwd = tmpdir.chdir()
3232
default_script_file = r.RInputSpec().script_file
3333

3434
rc = r.RCommand(r_cmd="foo_m")
@@ -46,6 +46,7 @@ def test_run_interface(tmpdir):
4646
assert os.path.exists(default_script_file), "scriptfile should exist 3."
4747
if os.path.exists(default_script_file): # cleanup
4848
os.remove(default_script_file)
49+
cwd.chdir()
4950

5051

5152

0 commit comments

Comments
 (0)