@@ -98,14 +98,18 @@ class WarpPoints(TVTKBaseInterface):
98
98
>>> from nipype.algorithms.mesh import WarpPoints
99
99
>>> if not have_tvtk:
100
100
... wp = WarpPoints()
101
- Traceback (most recent call last):
102
- ...
103
- ImportError: This interface requires tvtk to run.
104
101
>>> else:
105
102
... wp = WarpPoints()
106
103
... wp.inputs.points = 'surf1.vtk'
107
104
... wp.inputs.warp = 'warpfield.nii'
108
105
... 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
+
109
113
110
114
"""
111
115
input_spec = WarpPointsInputSpec
@@ -228,14 +232,17 @@ class ComputeMeshWarp(TVTKBaseInterface):
228
232
>>> import nipype.algorithms.mesh as m
229
233
>>> if not have_tvtk:
230
234
... dist = m.ComputeMeshWarp()
231
- Traceback (most recent call last):
232
- ...
233
- ImportError: This interface requires tvtk to run.
234
235
>>> else:
235
236
... dist = m.ComputeMeshWarp()
236
237
... dist.inputs.surface1 = 'surf1.vtk'
237
238
... dist.inputs.surface2 = 'surf2.vtk'
238
239
... 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.
239
246
240
247
"""
241
248
@@ -366,15 +373,18 @@ class MeshWarpMaths(TVTKBaseInterface):
366
373
>>> import nipype.algorithms.mesh as m
367
374
>>> if not have_tvtk:
368
375
... mmath = m.MeshWarpMaths()
369
- Traceback (most recent call last):
370
- ...
371
- ImportError: This interface requires tvtk to run.
372
376
>>> else:
373
377
... mmath = m.MeshWarpMaths()
374
378
... mmath.inputs.in_surf = 'surf1.vtk'
375
379
... mmath.inputs.operator = 'surf2.vtk'
376
380
... mmath.inputs.operation = 'mul'
377
381
... 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.
378
388
379
389
"""
380
390
0 commit comments