Skip to content

Commit 03e64b8

Browse files
committed
Doctest fix, better error reporting.
1 parent aabe729 commit 03e64b8

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

nipype/interfaces/io.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -592,20 +592,20 @@ class DataFinder(IOBase):
592592
>>> df = DataFinder()
593593
>>> df.inputs.root_paths = '.'
594594
>>> df.inputs.match_regex = '.+/(?P<series_dir>.+(qT1|ep2d_fid_T1).+)/(?P<basename>.+)\.nii.gz'
595-
>>> result = df.run()
596-
>>> print result.outputs.out_paths
595+
>>> result = df.run() # doctest: +SKIP
596+
>>> print result.outputs.out_paths # doctest: +SKIP
597597
['./027-ep2d_fid_T1_Gd4/acquisition.nii.gz',
598598
'./018-ep2d_fid_T1_Gd2/acquisition.nii.gz',
599599
'./016-ep2d_fid_T1_Gd1/acquisition.nii.gz',
600600
'./013-ep2d_fid_T1_pre/acquisition.nii.gz']
601601
602-
>>> print result.outputs.series_dir
602+
>>> print result.outputs.series_dir # doctest: +SKIP
603603
['027-ep2d_fid_T1_Gd4',
604604
'018-ep2d_fid_T1_Gd2',
605605
'016-ep2d_fid_T1_Gd1',
606606
'013-ep2d_fid_T1_pre']
607607
608-
>>> print result.outputs.basename
608+
>>> print result.outputs.basename # doctest: +SKIP
609609
['acquisition',
610610
'acquisition',
611611
'acquisition',
@@ -695,6 +695,8 @@ def _run_interface(self, runtime):
695695
for key, vals in self.result.iteritems():
696696
self.result[key] = vals[0]
697697

698+
if not self.result:
699+
raise RuntimeError("Regular expression did not match any files!")
698700
return runtime
699701

700702
def _list_outputs(self):

0 commit comments

Comments
 (0)