17 lines
433 B
Python
17 lines
433 B
Python
#!/usr/bin/python3
|
|
|
|
import pytest
|
|
|
|
|
|
def pytest_addoption(parser):
|
|
parser.addoption(
|
|
"--fast", action="store_true", help="Run only fast tests")
|
|
|
|
|
|
def pytest_collection_modifyitems(config, items):
|
|
if config.getoption("--fast"):
|
|
skip_slow = pytest.mark.skip(reason="Runs only without --fast option.")
|
|
|
|
for item in items:
|
|
if "slow" in item.keywords:
|
|
item.add_marker(skip_slow)
|