Skip to content

Commit 49af485

Browse files
committed
removed stray text files generated by tests, and changed tests so that they put them in a temp dir
1 parent 3ac52a1 commit 49af485

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

new_file_1.txt

Whitespace-only changes.

new_file_2.txt

Whitespace-only changes.

newfile_tmp.txt

Whitespace-only changes.

pydra/engine/tests/test_shelltask.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,8 @@ def test_shell_cmd_inputspec_7(plugin, results_function, tmp_path):
733733
using name_tamplate in metadata
734734
"""
735735
cmd = "touch"
736-
arg = "newfile_tmp.txt"
736+
arg = tmp_path / "newfile_tmp.txt"
737+
cache_dir = tmp_path / "cache"
737738

738739
@shell.define
739740
class Shelly(ShellDef["Shelly.Outputs"]):
@@ -749,12 +750,12 @@ class Outputs(ShellOutputs):
749750

750751
shelly = Shelly(executable=cmd, arg=arg)
751752

752-
outputs = results_function(shelly, plugin=plugin, cache_dir=tmp_path)
753+
outputs = results_function(shelly, plugin=plugin, cache_dir=cache_dir)
753754
assert outputs.stdout == ""
754755
out1 = outputs.out1.fspath
755756
assert out1.exists()
756757
# checking if the file is created in a good place
757-
assert out1.parent.parent == tmp_path
758+
assert out1.parent.parent == cache_dir
758759
assert out1.name == "newfile_tmp.txt"
759760

760761

@@ -2715,11 +2716,11 @@ class Outputs(ShellOutputs):
27152716
)
27162717

27172718
shelly = Shelly(executable=cmd)
2718-
shelly.file1 = "new_file_1.txt"
2719-
shelly.file2 = "new_file_2.txt"
2719+
shelly.file1 = tmp_path / "new_file_1.txt"
2720+
shelly.file2 = tmp_path / "new_file_2.txt"
27202721
shelly.additional_inp = 2
27212722

2722-
outputs = shelly(cache_dir=tmp_path)
2723+
outputs = shelly(cache_dir=tmp_path / "cache")
27232724
assert outputs.stdout == ""
27242725
assert outputs.newfile1.fspath.exists()
27252726
assert outputs.newfile2.fspath.exists()
@@ -2946,9 +2947,9 @@ class Outputs(ShellOutputs):
29462947
)
29472948

29482949
shelly = Shelly(executable=cmd)
2949-
shelly.file1 = "new_file_1.txt"
2950+
shelly.file1 = tmp_path / "new_file_1.txt"
29502951

2951-
outputs = shelly(cache_dir=tmp_path)
2952+
outputs = shelly(cache_dir=tmp_path / "cache")
29522953
assert outputs.stdout == ""
29532954
# neither additional_inp_A nor additional_inp_B is set, so newfile1 is None
29542955
assert outputs.newfile1 is None

0 commit comments

Comments
 (0)