Skip to content

Commit 89df112

Browse files
committed
fix: ensure doc tests are run from the testing/data directory
1 parent df8fbaf commit 89df112

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

nipype/interfaces/fsl/maths.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
"""
44
The maths module provides higher-level interfaces to some of the operations
55
that can be performed with the fslmaths command-line program.
6+
7+
Change directory to provide relative paths for doctests
8+
>>> import os
9+
>>> filepath = os.path.dirname( os.path.realpath( __file__ ) )
10+
>>> datadir = os.path.realpath(os.path.join(filepath, '../../testing/data'))
11+
>>> os.chdir(datadir)
612
"""
713
from __future__ import division
814
import os
@@ -293,11 +299,11 @@ class MultiImageMaths(MathsCommand):
293299
--------
294300
>>> from nipype.interfaces.fsl import MultiImageMaths
295301
>>> maths = MultiImageMaths()
296-
>>> maths.inputs.in_file = "functional.nii" # doctest: +SKIP
302+
>>> maths.inputs.in_file = "functional.nii"
297303
>>> maths.inputs.op_string = "-add %s -mul -1 -div %s"
298-
>>> maths.inputs.operand_files = ["functional2.nii", "functional3.nii"] # doctest: +SKIP
299-
>>> maths.inputs.out_file = "functional4.nii" # doctest: +SKIP
300-
>>> maths.cmdline # doctest: +SKIP
304+
>>> maths.inputs.operand_files = ["functional2.nii", "functional3.nii"]
305+
>>> maths.inputs.out_file = "functional4.nii"
306+
>>> maths.cmdline
301307
'fslmaths functional.nii -add functional2.nii -mul -1 -div functional3.nii functional4.nii'
302308
303309
"""

0 commit comments

Comments
 (0)