Skip to content

Commit 7c7b719

Browse files
committed
fixed doctests
1 parent db08c4f commit 7c7b719

File tree

2 files changed

+20
-10
lines changed

2 files changed

+20
-10
lines changed

circle.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ dependencies:
1919
- echo 'source /etc/afni/afni.sh' >> $HOME/.profile
2020
# Enable system-wide vtk
2121
- echo 'ln -sf /usr/lib/pymodules/python2.7/vtk ~/virtualenvs/venv-system/lib/python2.7/site-packages/' >> $HOME/.profile
22-
- ln -s /usr/lib/pymodules/python2.7/vtk ~/virtualenvs/venv-system/lib/python2.7/site-packages/
22+
- ln -sf /usr/lib/pymodules/python2.7/vtk ~/virtualenvs/venv-system/lib/python2.7/site-packages/
2323
# Set up python environment
2424
- pip install --upgrade pip
2525
- pip install -e .

nipype/algorithms/mesh.py

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,18 @@ class WarpPoints(TVTKBaseInterface):
9898
>>> from nipype.algorithms.mesh import WarpPoints
9999
>>> if not have_tvtk:
100100
... wp = WarpPoints()
101-
Traceback (most recent call last):
102-
...
103-
ImportError: This interface requires tvtk to run.
104101
>>> else:
105102
... wp = WarpPoints()
106103
... wp.inputs.points = 'surf1.vtk'
107104
... wp.inputs.warp = 'warpfield.nii'
108105
... res = wp.run() # doctest: +SKIP
106+
# Exceptions cannot be tested conditionally, so raise error
107+
# https://docs.python.org/2/library/doctest.html#id2
108+
... raise ImportError('This interface requires tvtk to run.')
109+
Traceback (most recent call last):
110+
...
111+
ImportError: This interface requires tvtk to run.
112+
109113
110114
"""
111115
input_spec = WarpPointsInputSpec
@@ -228,14 +232,17 @@ class ComputeMeshWarp(TVTKBaseInterface):
228232
>>> import nipype.algorithms.mesh as m
229233
>>> if not have_tvtk:
230234
... dist = m.ComputeMeshWarp()
231-
Traceback (most recent call last):
232-
...
233-
ImportError: This interface requires tvtk to run.
234235
>>> else:
235236
... dist = m.ComputeMeshWarp()
236237
... dist.inputs.surface1 = 'surf1.vtk'
237238
... dist.inputs.surface2 = 'surf2.vtk'
238239
... res = dist.run() # doctest: +SKIP
240+
# Exceptions cannot be tested conditionally, so raise error
241+
# https://docs.python.org/2/library/doctest.html#id2
242+
... raise ImportError('This interface requires tvtk to run.')
243+
Traceback (most recent call last):
244+
...
245+
ImportError: This interface requires tvtk to run.
239246
240247
"""
241248

@@ -366,15 +373,18 @@ class MeshWarpMaths(TVTKBaseInterface):
366373
>>> import nipype.algorithms.mesh as m
367374
>>> if not have_tvtk:
368375
... mmath = m.MeshWarpMaths()
369-
Traceback (most recent call last):
370-
...
371-
ImportError: This interface requires tvtk to run.
372376
>>> else:
373377
... mmath = m.MeshWarpMaths()
374378
... mmath.inputs.in_surf = 'surf1.vtk'
375379
... mmath.inputs.operator = 'surf2.vtk'
376380
... mmath.inputs.operation = 'mul'
377381
... res = mmath.run() # doctest: +SKIP
382+
# Exceptions cannot be tested conditionally, so raise error
383+
# https://docs.python.org/2/library/doctest.html#id2
384+
... raise ImportError('This interface requires tvtk to run.')
385+
Traceback (most recent call last):
386+
...
387+
ImportError: This interface requires tvtk to run.
378388
379389
"""
380390

0 commit comments

Comments
 (0)