Skip to content

Commit 3bb84c4

Browse files
committed
using TriatError in pytest.raises
1 parent 7b3d98c commit 3bb84c4

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

nipype/interfaces/tests/test_io.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import pytest
1717
import nipype
1818
import nipype.interfaces.io as nio
19-
from nipype.interfaces.base import Undefined
19+
from nipype.interfaces.base import Undefined, TraitError
2020

2121
# Check for boto
2222
noboto = False
@@ -409,9 +409,8 @@ def test_freesurfersource():
409409

410410
def test_freesurfersource_incorrectdir():
411411
fss = nio.FreeSurferSource()
412-
with pytest.raises(Exception) as err:
412+
with pytest.raises(TraitError) as err:
413413
fss.inputs.subjects_dir = 'path/to/no/existing/directory'
414-
assert "TraitError" == err.typename
415414

416415

417416
def test_jsonsink_input():

0 commit comments

Comments
 (0)