@@ -2460,14 +2460,14 @@ def test_wf_shell_cmd_3a(plugin, tmp_path):
2460
2460
assert res .output .cp_file .fspath .exists ()
2461
2461
2462
2462
2463
- def test_wf_shell_cmd_state_1 (plugin ):
2463
+ def test_wf_shell_cmd_state_1 (plugin , tmp_path ):
2464
2464
"""a workflow with 2 tasks and splitter on the wf level,
2465
2465
first one has input with output_file_template (str, uses wf.lzin),
2466
2466
that is passed to the second task
2467
2467
"""
2468
- wf = Workflow (name = "wf" , input_spec = [ "cmd1" , "cmd2" , "args" ]). split (
2469
- "args " , args = ["newfile_1.txt " , "newfile_2.txt" ]
2470
- )
2468
+ wf = Workflow (
2469
+ name = "wf " , input_spec = ["cmd1 " , "cmd2" , "args" ], cache_dir = tmp_path
2470
+ ). split ( "args" , args = [ "newfile_1.txt" , "newfile_2.txt" ])
2471
2471
2472
2472
wf .inputs .cmd1 = "touch"
2473
2473
wf .inputs .cmd2 = "cp"
@@ -2820,7 +2820,7 @@ def gather_output(field, output_dir):
2820
2820
2821
2821
2822
2822
@pytest .mark .parametrize ("results_function" , [result_no_submitter , result_submitter ])
2823
- def test_shell_cmd_outputspec_5a (plugin , results_function ):
2823
+ def test_shell_cmd_outputspec_5a (plugin , results_function , tmp_path ):
2824
2824
"""
2825
2825
customised output_spec, adding files to the output,
2826
2826
using a function to collect output, the function is saved in the field metadata
@@ -2842,7 +2842,9 @@ def gather_output(executable, output_dir):
2842
2842
],
2843
2843
bases = (ShellOutSpec ,),
2844
2844
)
2845
- shelly = ShellCommandTask (name = "shelly" , executable = cmd , output_spec = my_output_spec )
2845
+ shelly = ShellCommandTask (
2846
+ name = "shelly" , executable = cmd , output_spec = my_output_spec , cache_dir = tmp_path
2847
+ )
2846
2848
2847
2849
res = results_function (shelly , plugin )
2848
2850
assert res .output .stdout == ""
@@ -2874,7 +2876,7 @@ def gather_output(executable, output_dir, ble):
2874
2876
2875
2877
2876
2878
@pytest .mark .parametrize ("results_function" , [result_no_submitter , result_submitter ])
2877
- def test_shell_cmd_outputspec_5c (plugin , results_function ):
2879
+ def test_shell_cmd_outputspec_5c (plugin , results_function , tmp_path ):
2878
2880
"""
2879
2881
Customised output spec defined as a class,
2880
2882
using a static function to collect output files.
@@ -2893,6 +2895,7 @@ def gather_output(executable, output_dir):
2893
2895
name = "shelly" ,
2894
2896
executable = ["touch" , "newfile_tmp1.txt" , "newfile_tmp2.txt" ],
2895
2897
output_spec = SpecInfo (name = "Output" , bases = (MyOutputSpec ,)),
2898
+ cache_dir = tmp_path ,
2896
2899
)
2897
2900
2898
2901
res = results_function (shelly , plugin )
@@ -3177,7 +3180,7 @@ def get_stderr(stderr):
3177
3180
)
3178
3181
3179
3182
shelly = ShellCommandTask (
3180
- name = "shelly" , executable = cmd , output_spec = my_output_spec
3183
+ name = "shelly" , executable = cmd , output_spec = my_output_spec , cache_dir = tmp_path
3181
3184
).split ("args" , args = args )
3182
3185
3183
3186
results = results_function (shelly , plugin )
@@ -3248,6 +3251,7 @@ def get_lowest_directory(directory_path):
3248
3251
executable = cmd ,
3249
3252
output_spec = my_output_spec ,
3250
3253
resultsDir = "outdir" ,
3254
+ cache_dir = tmp_path ,
3251
3255
).split ("args" , args = args )
3252
3256
3253
3257
results_function (shelly , plugin )
0 commit comments