Skip to content

Commit 66919ab

Browse files
authored
Merge pull request #603 from djarecka/graph_test
Graph test
2 parents a9ef35f + 986d539 commit 66919ab

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

pydra/engine/task.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,7 @@ class DockerTask(ContainerTask):
686686

687687
def __init__(
688688
self,
689-
name,
689+
name=None,
690690
audit_flags: AuditFlag = AuditFlag.NONE,
691691
cache_dir=None,
692692
input_spec: ty.Optional[SpecInfo] = None,
@@ -769,6 +769,7 @@ class SingularityTask(ContainerTask):
769769

770770
def __init__(
771771
self,
772+
name=None,
772773
audit_flags: AuditFlag = AuditFlag.NONE,
773774
cache_dir=None,
774775
input_spec: ty.Optional[SpecInfo] = None,
@@ -808,6 +809,7 @@ def __init__(
808809
name="Inputs", fields=[], bases=(SingularitySpec,)
809810
)
810811
super().__init__(
812+
name=name,
811813
input_spec=input_spec,
812814
output_spec=output_spec,
813815
audit_flags=audit_flags,

pydra/engine/tests/test_workflow.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4192,6 +4192,7 @@ def test_wf_upstream_error2(plugin, tmpdir):
41924192
assert "raised an error" in str(excinfo.value)
41934193

41944194

4195+
@pytest.mark.flaky(reruns=2) # when slurm
41954196
def test_wf_upstream_error3(plugin, tmpdir):
41964197
"""task2 dependent on task1, task1 errors, task-level split on task 1
41974198
goal - workflow finish running, one output errors but the other doesn't
@@ -4455,13 +4456,15 @@ def exporting_graphs(wf, name):
44554456
print("\n pdf of the detailed graph in: ", formatted_dot[0])
44564457

44574458

4458-
def test_graph_1(tmpdir):
4459+
@pytest.mark.parametrize("splitter", [None, "x"])
4460+
def test_graph_1(tmpdir, splitter):
44594461
"""creating a set of graphs, wf with two nodes"""
44604462
wf = Workflow(name="wf", input_spec=["x", "y"], cache_dir=tmpdir)
44614463
wf.add(multiply(name="mult_1", x=wf.lzin.x, y=wf.lzin.y))
44624464
wf.add(multiply(name="mult_2", x=wf.lzin.x, y=wf.lzin.x))
44634465
wf.add(add2(name="add2", x=wf.mult_1.lzout.out))
44644466
wf.set_output([("out", wf.add2.lzout.out)])
4467+
wf.split(splitter)
44654468

44664469
# simple graph
44674470
dotfile_s = wf.create_dotfile()

0 commit comments

Comments
 (0)