Skip to content

Commit 4e53c48

Browse files
committed
fix tests that test relative cache paths
1 parent 7bc5835 commit 4e53c48

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

pydra/engine/tests/test_helpers_file.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import os
1+
import os, sys
22
import time
33
import warnings
44
import pytest

pydra/engine/tests/test_node_task.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -538,13 +538,13 @@ def test_task_nostate_cachedir(plugin, tmpdir):
538538
assert results.output.out == 5
539539

540540

541-
# TODO: fix path for windows
542-
@pytest.mark.skipif(sys.platform.startswith("win"), 'windows cache paths are saved differently')
543541
@pytest.mark.parametrize("plugin", Plugins)
544542
def test_task_nostate_cachedir_relativepath(tmpdir, plugin):
545543
""" task with provided cache_dir as relative path"""
546544
cwd = tmpdir.chdir()
547545
cache_dir = "test_task_nostate"
546+
tmpdir.mkdir(cache_dir)
547+
548548
nn = fun_addtwo(name="NA", a=3, cache_dir=cache_dir)
549549
assert np.allclose(nn.inputs.a, [3])
550550
assert nn.state is None

pydra/engine/tests/test_shelltask.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import attr
44
import typing as ty
5-
import os, shutil
5+
import os, sys, shutil
66
import pytest
77
from pathlib import Path
88

@@ -13,7 +13,7 @@
1313
from ..specs import ShellOutSpec, ShellSpec, SpecInfo, File
1414

1515

16-
if not sys.platform.startswith("win"):
16+
if sys.platform.startswith("win"):
1717
pytest.skip("SLURM not available in windows", allow_module_level=True)
1818

1919
if bool(shutil.which("sbatch")):

pydra/engine/tests/test_task.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,6 @@ def testfunc(a: int, b: float = 0.1) -> ty.NamedTuple("Output", [("out", float)]
350350
assert (tmpdir / funky.checksum / "messages.jsonld").exists()
351351

352352

353-
@pytest.mark.skipif(sys.platform.startswith("win"), "skip shell tasks for windows")
354353
def test_shell_cmd(tmpdir):
355354
cmd = ["echo", "hail", "pydra"]
356355

pydra/engine/tests/test_workflow.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1982,12 +1982,13 @@ def test_wf_nostate_cachedir(plugin, tmpdir):
19821982

19831983

19841984
# TODO: fix path for windows
1985-
@pytest.mark.skipif(sys.platform.startswith("win"), "failing for windows, something to do with paths?")
1985+
#@pytest.mark.skipif(sys.platform.startswith("win"), reason="failing for windows, something to do with paths?")
19861986
@pytest.mark.parametrize("plugin", Plugins)
19871987
def test_wf_nostate_cachedir_relativepath(tmpdir, plugin):
19881988
""" wf with provided cache_dir as relative path"""
19891989
tmpdir.chdir()
19901990
cache_dir = "test_wf_cache_2"
1991+
tmpdir.mkdir(cache_dir)
19911992

19921993
wf = Workflow(name="wf_2", input_spec=["x", "y"], cache_dir=cache_dir)
19931994
wf.add(multiply(name="mult", x=wf.lzin.x, y=wf.lzin.y))

0 commit comments

Comments
 (0)