Refactor the tests to use --run-docker and --run-podman

Simplified test setup using a parameterised fixture. The VFS test
is now just a single test that handles its own clean up.
This commit is contained in:
Joe Rickerby
2022-06-27 16:45:27 +01:00
parent d9b4644286
commit 6a371aca73
2 changed files with 138 additions and 226 deletions
+1 -14
View File
@@ -8,20 +8,7 @@ MOCK_PACKAGE_DIR = Path("some_package_dir")
def pytest_addoption(parser):
parser.addoption("--run-docker", action="store_true", default=False, help="run docker tests")
def pytest_configure(config):
config.addinivalue_line("markers", "docker: mark test requiring docker to run")
def pytest_collection_modifyitems(config, items):
if config.getoption("--run-docker"):
# --run-docker given in cli: do not skip container tests
return
skip_docker = pytest.mark.skip(reason="need --run-docker option to run")
for item in items:
if "docker" in item.keywords:
item.add_marker(skip_docker)
parser.addoption("--run-podman", action="store_true", default=False, help="run podman tests")
@pytest.fixture