From 102187be58c3669d2bcef6ca76d3e898d663c4ef Mon Sep 17 00:00:00 2001 From: Ruslan Kuprieiev Date: Thu, 23 Jul 2020 05:55:46 +0300 Subject: [PATCH] tests: check if docker is present (#4263) https://travis-ci.com/github/iterative/dvc/jobs/364061489#L3623 --- tests/remotes/__init__.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/tests/remotes/__init__.py b/tests/remotes/__init__.py index 96421827b..6a5b80166 100644 --- a/tests/remotes/__init__.py +++ b/tests/remotes/__init__.py @@ -37,7 +37,21 @@ from .ssh import ( # noqa: F401; noqa: F401 @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):