Skip to content

Commit 02991da

Browse files
committed
FIX: get length of generator + STY: Black
1 parent 27a2472 commit 02991da

File tree

1 file changed

+14
-16
lines changed

1 file changed

+14
-16
lines changed

nipype/pipeline/plugins/tests/test_sgelike.py

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
def 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)
2929
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

Comments
 (0)