Skip to content

Commit f6ff11f

Browse files
committed
cleaning up test failures
1 parent 107c9e5 commit f6ff11f

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

pydra/engine/tests/test_environments.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,10 @@ def newcache(x):
116116
worker="cf", cache_dir=newcache("docker_sub"), environment=docker
117117
) as sub:
118118
result = sub(shelly)
119-
assert outputs_dict == attrs_values(result.outputs)
119+
assert drop_stderr(outputs_dict) == drop_stderr(attrs_values(result.outputs))
120120

121121
outputs = shelly(cache_dir=newcache("docker_call"), environment=docker)
122-
assert outputs_dict == attrs_values(outputs)
122+
assert drop_stderr(outputs_dict) == drop_stderr(attrs_values(outputs))
123123

124124

125125
@no_win

pydra/engine/tests/test_specs.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,14 @@
2222
FunAddVar,
2323
ListSum,
2424
FileOrIntIdentity,
25+
FileAndIntIdentity,
2526
ListOfListOfFileOrIntIdentity,
2627
ListOfDictOfFileOrIntIdentity,
2728
)
2829

2930

3031
@workflow.define
31-
def TestWorkflow(x: int, y: list[int]) -> int:
32+
def ATestWorkflow(x: int, y: list[int]) -> int:
3233
node_a = workflow.add(FunAddTwo(a=x), name="A")
3334
node_b = workflow.add(FunAddVar(a=node_a.out).split(b=y).combine("b"), name="B")
3435
node_c = workflow.add(ListSum(x=node_b.out), name="C")
@@ -37,7 +38,7 @@ def TestWorkflow(x: int, y: list[int]) -> int:
3738

3839
@pytest.fixture
3940
def workflow_task(submitter: Submitter) -> WorkflowDef:
40-
wf = TestWorkflow(x=1, y=[1, 2, 3])
41+
wf = ATestWorkflow(x=1, y=[1, 2, 3])
4142
with submitter:
4243
submitter(wf)
4344
return wf
@@ -175,7 +176,7 @@ def test_input_file_hash_3(tmp_path):
175176
with open(file, "w") as f:
176177
f.write("hello")
177178

178-
a = FileOrIntIdentity(in_file=file, in_int=3)
179+
a = FileAndIntIdentity(in_file=file, in_int=3)
179180
# original hash and files_hash (dictionary contains info about files)
180181
hash1 = a._hash
181182
# files_hash1 = deepcopy(my_inp.files_hash)
@@ -228,7 +229,7 @@ def test_input_file_hash_4(tmp_path):
228229

229230
# checking specific hash value
230231
hash1 = ListOfListOfFileOrIntIdentity(in_file=[[file, 3]])._hash
231-
assert hash1 == "b583e0fd5501d3bed9bf510ce2a9e379"
232+
assert hash1 == "2c35c94089b00a7a399d3d4faf208fee"
232233

233234
# the same file, but int field changes
234235
hash1a = ListOfListOfFileOrIntIdentity(in_file=[[file, 5]])._hash
@@ -258,7 +259,7 @@ def test_input_file_hash_5(tmp_path):
258259

259260
# checking specific hash value
260261
hash1 = ListOfDictOfFileOrIntIdentity(in_file=[{"file": file, "int": 3}])._hash
261-
assert hash1 == "aa2d4b708ed0dd8340582a6514bfd5ce"
262+
assert hash1 == "7692ffe0b3323c13ecbd642b494f1f53"
262263

263264
# the same file, but int field changes
264265
hash1a = ListOfDictOfFileOrIntIdentity(in_file=[{"file": file, "int": 5}])._hash

pydra/engine/tests/utils.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,11 @@ def FileOrIntIdentity(in_file: ty.Union[File, int]) -> File:
196196
return in_file
197197

198198

199+
@python.define
200+
def FileAndIntIdentity(in_file: File, in_int: int) -> File:
201+
return in_file, in_int
202+
203+
199204
@python.define
200205
def ListOfListOfFileOrIntIdentity(
201206
in_file: ty.List[ty.List[ty.Union[int, File]]],

0 commit comments

Comments
 (0)