Skip to content

Commit 60f4604

Browse files
committed
avoid name clashes in test workflows
1 parent 7f4745c commit 60f4604

File tree

1 file changed

+5
-22
lines changed

1 file changed

+5
-22
lines changed

pydra/compose/tests/test_workflow_fields.py

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -528,29 +528,13 @@ def InputAccessWorkflow(a, b, c):
528528
def test_workflow_lzout_inputs2(tmp_path: Path):
529529

530530
@workflow.define
531-
def InputAccessWorkflow(a, b, c):
531+
def InputAccessWorkflow2(a, b, c):
532532
add = workflow.add(Add(a=a, b=b))
533533
add.inputs.a = c
534534
mul = workflow.add(Mul(a=add.out, b=b))
535535
return mul.out
536536

537-
input_access_workflow = InputAccessWorkflow(a=1, b=2.0, c=3.0)
538-
outputs = input_access_workflow(cache_root=tmp_path)
539-
assert outputs.out == 10.0
540-
541-
542-
def test_workflow_lzout_inputs2(tmp_path: Path):
543-
"""Set the inputs of the 'add' node after its outputs have been accessed
544-
but the state has not been altered"""
545-
546-
@workflow.define
547-
def InputAccessWorkflow(a, b, c):
548-
add = workflow.add(Add(a=a, b=b))
549-
mul = workflow.add(Mul(a=add.out, b=b))
550-
add.inputs.a = c
551-
return mul.out
552-
553-
input_access_workflow = InputAccessWorkflow(a=1, b=2.0, c=3.0)
537+
input_access_workflow = InputAccessWorkflow2(a=1, b=2.0, c=3.0)
554538
outputs = input_access_workflow(cache_root=tmp_path)
555539
assert outputs.out == 10.0
556540

@@ -561,15 +545,14 @@ def test_workflow_lzout_inputs_state_change_fail(tmp_path: Path):
561545
This changes the type of the input and is therefore not permitted"""
562546

563547
@workflow.define
564-
def InputAccessWorkflow(a, b, c):
548+
def InputAccessWorkflow3(a, b, c):
565549
add1 = workflow.add(Add(a=a, b=b), name="add1")
566550
add2 = workflow.add(Add(a=a).split(b=c), name="add2")
567551
mul1 = workflow.add(Mul(a=add1.out, b=b), name="mul1")
568-
mul2 = workflow.add(Mul(a=mul1.out, b=b), name="mul2")
552+
workflow.add(Mul(a=mul1.out, b=b), name="mul2")
569553
mul1.inputs.a = add2.out
570-
return mul2.out
571554

572-
input_access_workflow = InputAccessWorkflow(a=1, b=2.0, c=[3.0, 4.0])
555+
input_access_workflow = InputAccessWorkflow3(a=1, b=2.0, c=[3.0, 4.0])
573556
with pytest.raises(
574557
RuntimeError, match="have already been accessed and therefore cannot set"
575558
):

0 commit comments

Comments
 (0)