Skip to content

Commit 40fe321

Browse files
committed
changing need_docker, so tests are skipped when docker daemon is not running
1 parent d7d6d6e commit 40fe321

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

pydra/engine/tests/test_dockertask.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# -*- coding: utf-8 -*-
22

33
import os, shutil
4+
import subprocess as sp
45
import pytest
5-
from pathlib import Path
66
import dataclasses as dc
77

88
from ..task import DockerTask
@@ -16,7 +16,8 @@
1616
Plugins = ["cf"]
1717

1818
need_docker = pytest.mark.skipif(
19-
shutil.which("docker") is None, reason="no docker within the container"
19+
shutil.which("docker") is None or sp.call(["docker", "info"]),
20+
reason="no docker within the container",
2021
)
2122

2223

pydra/engine/tests/test_singularity.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# -*- coding: utf-8 -*-
22

33
import os, shutil
4+
import subprocess as sp
45
import pytest
56
import dataclasses as dc
67

@@ -16,7 +17,8 @@
1617

1718

1819
need_docker = pytest.mark.skipif(
19-
shutil.which("docker") is None, reason="no docker available"
20+
shutil.which("docker") is None or sp.call(["docker", "info"]),
21+
reason="no docker available",
2022
)
2123
need_singularity = pytest.mark.skipif(
2224
shutil.which("singularity") is None, reason="no singularity available"

0 commit comments

Comments
 (0)