Skip to content

Commit 95a30a7

Browse files
committed
using tmpdir.join where its possible (nibabel doesnt like py.path.local)
1 parent 52f379c commit 95a30a7

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

nipype/algorithms/tests/test_mesh_ops.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,13 @@
1515

1616
@pytest.mark.skipif(VTKInfo.no_tvtk(), reason="tvtk is not installed")
1717
def test_ident_distances(tmpdir):
18-
tempdir = tmpdir.strpath
19-
os.chdir(tempdir)
18+
tmpdir.chdir()
2019

2120
in_surf = example_data('surf01.vtk')
2221
dist_ident = m.ComputeMeshWarp()
2322
dist_ident.inputs.surface1 = in_surf
2423
dist_ident.inputs.surface2 = in_surf
25-
dist_ident.inputs.out_file = os.path.join(tempdir, 'distance.npy')
24+
dist_ident.inputs.out_file = tmpdir.join('distance.npy')
2625
res = dist_ident.run()
2726
assert res.outputs.distance == 0.0
2827

@@ -37,7 +36,7 @@ def test_trans_distances(tmpdir):
3736
from ...interfaces.vtkbase import tvtk
3837

3938
in_surf = example_data('surf01.vtk')
40-
warped_surf = os.path.join(tempdir, 'warped.vtk')
39+
warped_surf = tmpdir.join('warped.vtk')
4140

4241
inc = np.array([0.7, 0.3, -0.2])
4342

@@ -53,7 +52,7 @@ def test_trans_distances(tmpdir):
5352
dist = m.ComputeMeshWarp()
5453
dist.inputs.surface1 = in_surf
5554
dist.inputs.surface2 = warped_surf
56-
dist.inputs.out_file = os.path.join(tempdir, 'distance.npy')
55+
dist.inputs.out_file = tmpdir.join('distance.npy')
5756
res = dist.run()
5857
assert np.allclose(res.outputs.distance, np.linalg.norm(inc), 4)
5958
dist.inputs.weighting = 'area'

nipype/interfaces/freesurfer/tests/test_model.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@
1515

1616
@pytest.mark.skipif(no_freesurfer(), reason="freesurfer is not installed")
1717
def test_concatenate(tmpdir):
18+
tmpdir.chdir()
19+
1820
tempdir = tmpdir.strpath
19-
os.chdir(tempdir)
2021
in1 = os.path.join(tempdir, 'cont1.nii')
2122
in2 = os.path.join(tempdir, 'cont2.nii')
2223
out = 'bar.nii'

nipype/utils/tests/test_provenance.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def test_provenance():
2222

2323
def test_provenance_exists(tmpdir):
2424
tempdir = tmpdir.strpath
25-
os.chdir(tempdir)
25+
tmpdir.chdir()
2626
from nipype import config
2727
from nipype.interfaces.base import CommandLine
2828
provenance_state = config.get('execution', 'write_provenance')

0 commit comments

Comments
 (0)