Files

30 lines
863 B
Python
Executable File

"""
conftest.py for cristallina.
Read more about conftest.py under:
- https://docs.pytest.org/en/stable/fixture.html
- https://docs.pytest.org/en/stable/writing_plugins.html
"""
import pytest
def pytest_addoption(parser):
parser.addoption(
"--runregression", action="store_true", default=False, help="run slow regression tests"
)
def pytest_configure(config):
config.addinivalue_line("markers", "regression: mark test as a slow regression test to run")
def pytest_collection_modifyitems(config, items):
if config.getoption("--runregression"):
# --runregression given in cli: do not skip slow tests
return
skip_regression = pytest.mark.skip(reason="need --runregression option to run")
for item in items:
if "regression" in item.keywords:
item.add_marker(skip_regression)