@@ -70,6 +70,7 @@ def test_singularity_2(plugin, tmp_path):
7070 worker = plugin , environment = Singularity (image = image ), cache_dir = tmp_path
7171 ) as sub :
7272 res = sub (singu )
73+ assert not res .errored , "\n " .join (res .errors ["error message" ])
7374 assert res .outputs .stdout .strip () == " " .join (cmd [1 :])
7475 assert res .outputs .return_code == 0
7576
@@ -110,11 +111,13 @@ def test_singularity_st_1(plugin, tmp_path):
110111 singu = Singu ().split ("executable" , executable = cmd )
111112
112113 outputs = singu (
113- plugin = plugin , environment = Singularity (image = image ), cache_dir = tmp_path
114+ plugin = plugin ,
115+ environment = Singularity (image = image , xargs = ["--fakeroot" ]),
116+ cache_dir = tmp_path ,
114117 )
115- assert outputs .stdout [0 ] == "root"
116- assert outputs . stdout [ 1 ] == "/mnt/pydra"
117- assert outputs .stdout [2 ] == ""
118+ assert outputs .stdout [0 ]. strip () == "root"
119+ assert "/mnt/pydra" in outputs . stdout [ 1 ]
120+ assert outputs .stdout [2 ]. strip () == "_task.pklz "
118121 assert outputs .return_code == [0 , 0 , 0 ]
119122
120123
@@ -161,11 +164,10 @@ def test_singularity_outputspec_1(plugin, tmp_path):
161164 )
162165 singu = Singu ()
163166
164- with Submitter (
165- worker = plugin , environment = Singularity (image = image ), cache_dir = tmp_path
166- ) as sub :
167+ with Submitter (environment = Singularity (image = image ), cache_dir = tmp_path ) as sub :
167168 res = sub (singu )
168169
170+ assert not res .errored , "\n " .join (res .errors ["error message" ])
169171 assert res .outputs .stdout == ""
170172 assert res .outputs .newfile .fspath .exists ()
171173
@@ -386,7 +388,7 @@ class Singu(ShellDef["Singu.Outputs"]):
386388
387389 class Outputs (ShellOutputs ):
388390 out_file : File = shell .outarg (
389- path_template = "{orig_file}" ,
391+ path_template = "{orig_file}.txt" , # FIXME: Shouldn't have to specify the extension
390392 help = "output file" ,
391393 )
392394
@@ -396,7 +398,7 @@ class Outputs(ShellOutputs):
396398 assert outputs .stdout == ""
397399 assert outputs .out_file .fspath .exists ()
398400 # the file is copied, and than it is changed in place
399- assert outputs .out_file .fspath .parent == singu . output_dir
401+ assert outputs .out_file .fspath .parent . parent == tmp_path
400402 with open (outputs .out_file ) as f :
401403 assert "hi from pydra\n " == f .read ()
402404 # the original file is unchanged
0 commit comments