1313def crasher ():
1414 raise ValueError ()
1515
16-
17- def submit_batchtask (self , scriptfile , node ):
16+
17+ def submit_batchtask (self , scriptfile , node ):
1818 self ._pending [1 ] = node .output_dir ()
1919 subprocess .call (["bash" , scriptfile ])
2020 return 1
@@ -24,18 +24,16 @@ def is_pending(self, taskid):
2424 return False
2525
2626
27- @patch .object (SGELikeBatchManagerBase , ' _submit_batchtask' , new = submit_batchtask )
28- @patch .object (SGELikeBatchManagerBase , ' _is_pending' , new = is_pending )
27+ @patch .object (SGELikeBatchManagerBase , " _submit_batchtask" , new = submit_batchtask )
28+ @patch .object (SGELikeBatchManagerBase , " _is_pending" , new = is_pending )
2929def test_crashfile_creation (tmp_path ):
30- pipe = pe .Workflow (name = "pipe" , base_dir = str (tmp_path ))
31- pipe .config ["execution" ]["crashdump_dir" ] = str (tmp_path )
32- pipe .add_nodes ([pe .Node (interface = Function (function = crasher ),
33- name = "crasher" )])
34- sgelike_plugin = SGELikeBatchManagerBase ("" )
35- with pytest .raises (RuntimeError ) as e :
36- assert pipe .run (plugin = sgelike_plugin )
37- assert (str (e .value ) ==
38- "Workflow did not execute cleanly. Check log for details" )
39-
40- crashfiles = tmp_path .glob ("crash*crasher*.pklz" )
41- assert len (crashfiles ) == 1
30+ pipe = pe .Workflow (name = "pipe" , base_dir = str (tmp_path ))
31+ pipe .config ["execution" ]["crashdump_dir" ] = str (tmp_path )
32+ pipe .add_nodes ([pe .Node (interface = Function (function = crasher ), name = "crasher" )])
33+ sgelike_plugin = SGELikeBatchManagerBase ("" )
34+ with pytest .raises (RuntimeError ) as e :
35+ assert pipe .run (plugin = sgelike_plugin )
36+ assert str (e .value ) == "Workflow did not execute cleanly. Check log for details"
37+
38+ crashfiles = tmp_path .glob ("crash*crasher*.pklz" )
39+ assert len (list (crashfiles )) == 1
0 commit comments