Skip to content

Commit 63c1d7c

Browse files
committed
add skipif
1 parent 9b1e928 commit 63c1d7c

File tree

1 file changed

+30
-30
lines changed

1 file changed

+30
-30
lines changed

nipype/interfaces/dipy/tests/test_base.py

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
from collections import namedtuple
33
from ...base import traits, TraitedSpec, BaseInterfaceInputSpec
44
from ..base import (convert_to_traits_type, create_interface_specs,
5-
dipy_to_nipype_interface, DipyBaseInterface)
6-
from dipy.workflows.workflow import Workflow
5+
dipy_to_nipype_interface, DipyBaseInterface, no_dipy)
76

87

98
def test_convert_to_traits_type():
@@ -84,35 +83,36 @@ def test_create_interface_specs():
8483
assert 'out_params' in current_params.keys()
8584

8685

87-
class DummyWorkflow(Workflow):
88-
89-
@classmethod
90-
def get_short_name(cls):
91-
return 'dwf1'
92-
93-
def run(self, in_files, param1=1, out_dir='', out_ref='out1.txt'):
94-
"""Workflow used to test basic workflows.
95-
96-
Parameters
97-
----------
98-
in_files : string
99-
fake input string param
100-
param1 : int, optional
101-
fake positional param (default 1)
102-
out_dir : string, optional
103-
fake output directory (default '')
104-
out_ref : string, optional
105-
fake out file (default out1.txt)
106-
107-
References
108-
-----------
109-
dummy references
110-
111-
"""
112-
return param1
113-
114-
86+
@pytest.mark.skipif(no_dipy(), reason="DIPY is not installed")
11587
def test_dipy_to_nipype_interface():
88+
from dipy.workflows.workflow import Workflow
89+
90+
class DummyWorkflow(Workflow):
91+
92+
@classmethod
93+
def get_short_name(cls):
94+
return 'dwf1'
95+
96+
def run(self, in_files, param1=1, out_dir='', out_ref='out1.txt'):
97+
"""Workflow used to test basic workflows.
98+
99+
Parameters
100+
----------
101+
in_files : string
102+
fake input string param
103+
param1 : int, optional
104+
fake positional param (default 1)
105+
out_dir : string, optional
106+
fake output directory (default '')
107+
out_ref : string, optional
108+
fake out file (default out1.txt)
109+
110+
References
111+
-----------
112+
dummy references
113+
114+
"""
115+
return param1
116116

117117
new_specs = dipy_to_nipype_interface("MyModelSpec", DummyWorkflow)
118118
assert new_specs.__base__ == DipyBaseInterface

0 commit comments

Comments
 (0)