Skip to content

Commit 42d4960

Browse files
committed
cleaned up singularity unittests
1 parent d620301 commit 42d4960

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

pydra/engine/tests/test_singularity.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -438,8 +438,8 @@ def test_singularity_inputspec_state_1(tmp_path):
438438
singu = Singu().split("file", file=filename)
439439

440440
outputs = singu(environment=Singularity(image=image), cache_dir=tmp_path)
441-
assert outputs.stdout[0] == "hello from pydra"
442-
assert outputs.stdout[1] == "have a nice one"
441+
assert outputs.stdout[0].strip() == "hello from pydra"
442+
assert outputs.stdout[1].strip() == "have a nice one"
443443

444444

445445
@need_singularity
@@ -475,8 +475,8 @@ def test_singularity_inputspec_state_1b(plugin, tmp_path):
475475
singu = Singu().split("file", file=filename)
476476

477477
outputs = singu(environment=Singularity(image=image), cache_dir=tmp_path)
478-
assert outputs.stdout[0] == "hello from pydra"
479-
assert outputs.stdout[1] == "have a nice one"
478+
assert outputs.stdout[0].strip() == "hello from pydra"
479+
assert outputs.stdout[1].strip() == "have a nice one"
480480

481481

482482
@need_singularity
@@ -512,7 +512,7 @@ def Workflow(cmd: str, file: File) -> str:
512512
with Submitter(cache_dir=tmp_path) as sub:
513513
res = sub(Workflow(cmd=cmd, file=filename))
514514

515-
assert res.outputs.out == "hello from pydra"
515+
assert res.outputs.out.strip() == "hello from pydra"
516516

517517

518518
@need_singularity
@@ -555,7 +555,10 @@ def Workflow(cmd: str, file: File) -> str:
555555
with Submitter(worker=plugin, cache_dir=tmp_path) as sub:
556556
res = sub(wf)
557557

558-
assert res.outputs.out == ["hello from pydra", "have a nice one"]
558+
assert [o.strip() for o in res.outputs.out] == [
559+
"hello from pydra",
560+
"have a nice one",
561+
]
559562

560563

561564
@need_singularity
@@ -598,4 +601,7 @@ def Workflow(cmd: str, files: list[File]) -> list[str]:
598601
with Submitter(worker=plugin, cache_dir=tmp_path) as sub:
599602
res = sub(wf)
600603

601-
assert res.outputs.out == ["hello from pydra", "have a nice one"]
604+
assert [o.strip() for o in res.outputs.out] == [
605+
"hello from pydra",
606+
"have a nice one",
607+
]

0 commit comments

Comments
 (0)