Skip to content

Commit 9642522

Browse files
committed
TEST: Condition freesurfer test on command installation
1 parent 9e6e0fc commit 9642522

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

nipype/interfaces/freesurfer/base.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,3 +161,15 @@ def version(self):
161161
return ver.rstrip().split('-')[-1] + '.dev'
162162
else:
163163
return ver.rstrip().split('-v')[-1]
164+
165+
def no_freesurfer():
166+
"""Checks if FreeSurfer is NOT installed
167+
used with skipif to skip tests that will
168+
fail if FreeSurfer is not installed"""
169+
170+
if Info.version() is None:
171+
return True
172+
else:
173+
return False
174+
175+

nipype/interfaces/freesurfer/tests/test_model.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@
77
import numpy as np
88
import nibabel as nib
99

10-
from nipype.testing import assert_equal
11-
from nipype.interfaces.freesurfer import model
10+
from nipype.testing import assert_equal, skipif
11+
from nipype.interfaces.freesurfer import model, no_freesurfer
1212

1313

14+
@skipif(no_freesurfer)
1415
def test_concatenate():
1516
tmp_dir = tempfile.mkdtemp()
1617
cwd = os.getcwd()

0 commit comments

Comments
 (0)