Skip to content

Commit bfaea0e

Browse files
committed
TEST: Skip OAR test in absence of oarsub, use tmp_path fixture
1 parent 20eca54 commit bfaea0e

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

nipype/pipeline/plugins/tests/test_oar.py

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
import os
3-
from shutil import rmtree
4-
from tempfile import mkdtemp
2+
from shutil import which
53

64
import nipype.interfaces.base as nib
75
import pytest
@@ -31,13 +29,9 @@ def _list_outputs(self):
3129
return outputs
3230

3331

34-
@pytest.mark.xfail(reason="not known")
35-
def test_run_oar():
36-
cur_dir = os.getcwd()
37-
temp_dir = mkdtemp(prefix="test_engine_", dir=os.getcwd())
38-
os.chdir(temp_dir)
39-
40-
pipe = pe.Workflow(name="pipe")
32+
@pytest.mark.skipif(which('oarsub') is None, reason="OAR not installed")
33+
def test_run_pbsgraph(tmp_path):
34+
pipe = pe.Workflow(name="pipe", base_dir=str(tmp_path))
4135
mod1 = pe.Node(interface=OarTestInterface(), name="mod1")
4236
mod2 = pe.MapNode(interface=OarTestInterface(), iterfield=["input1"], name="mod2")
4337
pipe.connect([(mod1, mod2, [("output1", "input1")])])
@@ -48,5 +42,3 @@ def test_run_oar():
4842
node = list(execgraph.nodes())[names.index("pipe.mod1")]
4943
result = node.get_output("output1")
5044
assert result == [1, 1]
51-
os.chdir(cur_dir)
52-
rmtree(temp_dir)

0 commit comments

Comments
 (0)