From 471c7254374570af9663f9ae6a5cb453cbdfd85c Mon Sep 17 00:00:00 2001 From: Sorin Sbarnea Date: Tue, 20 Oct 2020 11:17:31 +0100 Subject: [PATCH] Verify presence of CONTAINER_HOST Related: https://github.com/containers/podman/issues/8070 --- conftest.py | 3 +++ lib/molecule_podman/test/conftest.py | 11 +++++++++++ lib/molecule_podman/test/test_func.py | 1 - 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 conftest.py diff --git a/conftest.py b/conftest.py new file mode 100644 index 0000000..6fed110 --- /dev/null +++ b/conftest.py @@ -0,0 +1,3 @@ +"""Pytest Config.""" + +pytest_plugins = ["helpers_namespace"] diff --git a/lib/molecule_podman/test/conftest.py b/lib/molecule_podman/test/conftest.py index 25ea5bf..3ed6326 100644 --- a/lib/molecule_podman/test/conftest.py +++ b/lib/molecule_podman/test/conftest.py @@ -1,8 +1,19 @@ """Pytest Fixtures.""" +import os +import platform + import pytest from molecule.test.conftest import random_string, temp_dir # noqa +def pytest_collection_finish(session): + """Fail fast if current environment is broken.""" + if "CONTAINER_HOST" in os.environ and platform.system() != "Darwin": + pytest.exit( + msg="CONTAINER_HOST is defined, see https://github.com/containers/podman/issues/8070" + ) + + @pytest.fixture def DRIVER(): """Return name of the driver to be tested.""" diff --git a/lib/molecule_podman/test/test_func.py b/lib/molecule_podman/test/test_func.py index dc44849..46f719a 100644 --- a/lib/molecule_podman/test/test_func.py +++ b/lib/molecule_podman/test/test_func.py @@ -20,7 +20,6 @@ def format_result(result: subprocess.CompletedProcess): ) -# @pytest.mark.xfail(reason="need to fix template path") def test_command_init_scenario(temp_dir, DRIVER): """Verify that init scenario works.""" role_directory = os.path.join(temp_dir.strpath, "test-init")