13
13
def crasher ():
14
14
raise ValueError ()
15
15
16
-
17
- def submit_batchtask (self , scriptfile , node ):
16
+
17
+ def submit_batchtask (self , scriptfile , node ):
18
18
self ._pending [1 ] = node .output_dir ()
19
19
subprocess .call (["bash" , scriptfile ])
20
20
return 1
@@ -24,18 +24,16 @@ def is_pending(self, taskid):
24
24
return False
25
25
26
26
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 )
29
29
def 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