File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
nipype/interfaces/cmtk/tests Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 4
4
import numpy as np
5
5
import networkx as nx
6
6
import pytest
7
+ from nibabel .testing import clear_and_catch_warnings
7
8
8
9
have_cv = True
9
10
try :
@@ -34,14 +35,17 @@ def test_importerror(creating_graphs, tmpdir):
34
35
group1 = graphlist [:3 ]
35
36
group2 = graphlist [3 :]
36
37
37
- nbs = NetworkBasedStatistic ()
38
+ with clear_and_catch_warnings () as w :
39
+ nbs = NetworkBasedStatistic ()
40
+ assert len (w ) == 1
41
+ assert str (w .message ).startswith ('Unable to import cviewer' )
38
42
nbs .inputs .in_group1 = group1
39
43
nbs .inputs .in_group2 = group2
40
44
nbs .inputs .edge_key = "weight"
41
45
42
46
with pytest .raises (ImportError ) as e :
43
47
nbs .run ()
44
- assert "cviewer library is not available " == str (e .value )
48
+ assert "No module named 'cviewer' " == str (e .value )
45
49
46
50
47
51
@pytest .mark .skipif (not have_cv , reason = "cviewer has to be available" )
You can’t perform that action at this time.
0 commit comments