Skip to content

Commit

Permalink
tests: check if docker is present (iterative#4263)
Browse files Browse the repository at this point in the history
  • Loading branch information
efiop authored Jul 23, 2020
1 parent 71e98cd commit 102187b
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion tests/remotes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,21 @@


@pytest.fixture(scope="session")
def docker_compose():
def docker():
import os

# See https://travis-ci.community/t/docker-linux-containers-on-windows/301
if os.environ.get("TRAVIS") and os.name == "nt":
pytest.skip("disabled for Windows on Travis")

try:
subprocess.check_output("docker ps", shell=True)
except (subprocess.CalledProcessError, OSError):
pytest.skip("no docker installed")


@pytest.fixture(scope="session")
def docker_compose(docker):
try:
subprocess.check_output("docker-compose version", shell=True)
except (subprocess.CalledProcessError, OSError):
Expand Down

0 comments on commit 102187b

Please sign in to comment.