Files
cibuildwheel/unit_test/conftest.py
T

20 lines
609 B
Python
Raw Normal View History

2020-06-26 21:37:02 +01:00
import pytest
def pytest_addoption(parser):
2021-04-30 17:56:34 -04:00
parser.addoption("--run-docker", action="store_true", default=False, help="run docker tests")
2020-06-26 21:37:02 +01:00
def pytest_configure(config):
config.addinivalue_line("markers", "docker: mark test requiring docker to run")
2020-06-26 21:37:02 +01:00
def pytest_collection_modifyitems(config, items):
if config.getoption("--run-docker"):
# --run-docker given in cli: do not skip docker tests
2020-06-26 21:37:02 +01:00
return
skip_docker = pytest.mark.skip(reason="need --run-docker option to run")
2020-06-26 21:37:02 +01:00
for item in items:
if "docker" in item.keywords:
item.add_marker(skip_docker)