From f03c9241f7658f2202fc551dc439c47c672fe081 Mon Sep 17 00:00:00 2001 From: Ruslan Kuprieiev Date: Thu, 23 Jul 2020 04:08:16 +0300 Subject: [PATCH] tests: check if docker is present 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 96421827b7..6a5b80166e 100644 --- a/tests/remotes/__init__.py +++ b/tests/remotes/__init__.py @@ -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):