Skip to content

Commit 5dcf577

Browse files
committed
fixed up test_shelltask to make it work with psijlocal
1 parent f1b4ebc commit 5dcf577

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

pydra/engine/tests/test_shelltask.py

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2254,8 +2254,11 @@ class Outputs(ShellOutputs):
22542254

22552255

22562256
@pytest.mark.xfail(
2257-
sys.version_info >= (3, 11) and platform.system() == "Linux",
2258-
reason="Fails on Python >= 3.11 on Ubuntu (presumably a typing thing with that version of Python)",
2257+
sys.version_info[:3] == (3, 11, 5),
2258+
reason=(
2259+
"Fails on Python 3.11.5 (presumably a typing thing with that specific "
2260+
"version of Python)"
2261+
),
22592262
)
22602263
@pytest.mark.parametrize("results_function", [run_no_submitter, run_submitter])
22612264
def test_shell_cmd_outputspec_7(tmp_path, plugin, results_function):
@@ -2476,8 +2479,9 @@ class Outputs(ShellOutputs):
24762479

24772480
shelly = Shelly(resultsDir="test")
24782481
assert get_output_names(shelly) == ["resultsDir", "return_code", "stderr", "stdout"]
2479-
outputs = results_function(shelly, plugin=plugin, cache_dir=tmp_path)
2480-
output_dir = next(tmp_path.iterdir())
2482+
cache_dir = tmp_path / "cache"
2483+
outputs = results_function(shelly, plugin=plugin, cache_dir=cache_dir)
2484+
output_dir = next(cache_dir.iterdir())
24812485
assert (output_dir / Path("test")).exists()
24822486
assert get_lowest_directory(outputs.resultsDir) == get_lowest_directory(
24832487
output_dir / Path("test")
@@ -3256,9 +3260,10 @@ class Outputs(ShellOutputs):
32563260
)
32573261

32583262
shelly = Shelly(out_name="test")
3259-
outputs = shelly(cache_dir=tmp_path)
3263+
cache_dir = tmp_path / "cache"
3264+
outputs = shelly(cache_dir=cache_dir)
32603265
# the first output file is created
3261-
assert outputs.out_1.fspath == next(tmp_path.iterdir()) / "test_1.nii"
3266+
assert outputs.out_1.fspath == next(cache_dir.iterdir()) / "test_1.nii"
32623267
assert outputs.out_1.fspath.exists()
32633268
# the second output file is not created
32643269
assert outputs.out_2 is None
@@ -3292,9 +3297,10 @@ class Outputs(ShellOutputs):
32923297

32933298
shelly = Shelly(out_name="test")
32943299

3295-
outputs = shelly(cache_dir=tmp_path)
3300+
cache_dir = tmp_path / "cache"
3301+
outputs = shelly(cache_dir=cache_dir)
32963302
# the first output file is created
3297-
assert outputs.out_1.fspath == next(tmp_path.iterdir()) / "test_1.nii"
3303+
assert outputs.out_1.fspath == next(cache_dir.iterdir()) / "test_1.nii"
32983304
assert outputs.out_1.fspath.exists()
32993305
# the second output file is not created
33003306
assert outputs.out_2 is None
@@ -3325,13 +3331,14 @@ class Outputs(ShellOutputs):
33253331

33263332
shelly = Shelly(out_name="test")
33273333
# An exception should be raised because the second mandatory output does not exist
3334+
cache_dir = tmp_path / "cache"
33283335
with pytest.raises(
33293336
ValueError,
33303337
match=r"file system path\(s\) provided to mandatory field .* does not exist",
33313338
):
3332-
shelly(cache_dir=tmp_path)
3339+
shelly(cache_dir=cache_dir)
33333340
# checking if the first output was created
3334-
assert (next(tmp_path.iterdir()) / "test_1.nii").exists()
3341+
assert (next(cache_dir.iterdir()) / "test_1.nii").exists()
33353342

33363343

33373344
def test_shell_cmd_non_existing_outputs_multi_1(tmp_path):

0 commit comments

Comments
 (0)