File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change 14
14
assert_false )
15
15
import nipype .interfaces .base as nib
16
16
import nipype .pipeline .engine as pe
17
+ from nipype import logging
17
18
18
19
class InputSpec (nib .TraitedSpec ):
19
20
input1 = nib .traits .Int (desc = 'a random int' )
@@ -443,6 +444,8 @@ def func2(a):
443
444
444
445
445
446
def test_mapnode_json ():
447
+ """Tests that mapnodes don't generate excess jsons
448
+ """
446
449
cwd = os .getcwd ()
447
450
wd = mkdtemp ()
448
451
os .chdir (wd )
@@ -462,11 +465,23 @@ def func1(in1):
462
465
w1 .run ()
463
466
n1 .inputs .in1 = [2 ]
464
467
w1 .run ()
468
+ # should rerun
465
469
n1 .inputs .in1 = [1 ]
466
470
eg = w1 .run ()
467
471
468
472
node = eg .nodes ()[0 ]
469
473
outjson = glob (os .path .join (node .output_dir (), '_0x*.json' ))
470
474
yield assert_equal , len (outjson ), 1
475
+
476
+ # check that multiple json's don't trigger rerun
477
+ with open (os .path .join (node .output_dir (), 'test.json' ), 'wt' ) as fp :
478
+ fp .write ('dummy file' )
479
+ w1 .config ['execution' ].update (** {'stop_on_first_rerun' : True })
480
+ error_raised = False
481
+ try :
482
+ w1 .run ()
483
+ except :
484
+ error_raised = True
485
+ yield assert_false , error_raised
471
486
os .chdir (cwd )
472
487
rmtree (wd )
You can’t perform that action at this time.
0 commit comments