mirror of
https://github.com/NousResearch/atropos.git
synced 2026-04-19 12:57:58 +00:00
23 lines
671 B
Python
23 lines
671 B
Python
import pytest
|
|
|
|
|
|
def pytest_addoption(parser):
|
|
parser.addoption(
|
|
"--runproviders", action="store_true", default=False, help="run provider tests"
|
|
)
|
|
|
|
|
|
def pytest_configure(config):
|
|
config.addinivalue_line(
|
|
"markers", "providers: mark test as requires providers api keys to run"
|
|
)
|
|
|
|
|
|
def pytest_collection_modifyitems(config, items):
|
|
if config.getoption("--runproviders"):
|
|
# --runproviders given in cli: do not skip slow tests
|
|
return
|
|
skip_providers = pytest.mark.skip(reason="need --runproviders option to run")
|
|
for item in items:
|
|
if "providers" in item.keywords:
|
|
item.add_marker(skip_providers)
|