blob: b4ca80cb453d11295dea1aa13f9d1854d16326c8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
import pytest
def pytest_addoption(parser):
parser.addoption(
"--compare", action="store_true", default=False, help="Run compare tests"
)
def pytest_configure(config):
config.addinivalue_line("markers", "compare: mark test as a comparison test")
def pytest_collection_modifyitems(config, items):
if config.getoption("--compare"):
return
skip_compare = pytest.mark.skip(reason="need --compare option to run")
for item in items:
if "compare" in item.keywords:
item.add_marker(skip_compare)
|