def test_mapnode_crash2(tmpdir):
 cwd = os.getcwd()
 node = pe.MapNode(niu.Function(input_names=[u'WRONG'], output_names=[u'newstring'], function=dummy_func), iterfield=[u'WRONG'], name=u'myfunc')
 node.inputs.WRONG = [u'string{}'.format(i) for i in range(3)]
 node.base_dir = str(tmpdir)
 with pytest.raises(Exception):
  node.run()
 os.chdir(cwd)

def test_mapnode_crash2 ( tmpdir ) : cwd = os . getcwd ( ) node = pe . MapNode ( niu . Function ( input_names = [ u'WRONG' ] , output_names = [ u'newstring' ] , function = dummy_func ) , iterfield = [ u'WRONG' ] , name = u'myfunc' ) node . inputs . WRONG = [ u'string{}' . format ( i ) for i in range ( 3 ) ] node . base_dir = str ( tmpdir ) with pytest . raises ( Exception ) : node . run ( ) os . chdir ( cwd )
test mapnode crash when stop_on_first_crash is false .