mirror of
https://github.com/PR0M3TH3AN/SeedPass.git
synced 2025-09-10 00:09:04 +00:00
Enable parallel and stress testing
This commit is contained in:
@@ -5,3 +5,28 @@ import pytest
|
||||
@pytest.fixture(autouse=True)
|
||||
def mute_logging():
|
||||
logging.getLogger().setLevel(logging.WARNING)
|
||||
|
||||
|
||||
def pytest_addoption(parser: pytest.Parser) -> None:
|
||||
parser.addoption(
|
||||
"--stress",
|
||||
action="store_true",
|
||||
default=False,
|
||||
help="run stress tests",
|
||||
)
|
||||
|
||||
|
||||
def pytest_configure(config: pytest.Config) -> None:
|
||||
config.addinivalue_line("markers", "stress: long running stress tests")
|
||||
|
||||
|
||||
def pytest_collection_modifyitems(
|
||||
config: pytest.Config, items: list[pytest.Item]
|
||||
) -> None:
|
||||
if config.getoption("--stress"):
|
||||
return
|
||||
|
||||
skip_stress = pytest.mark.skip(reason="need --stress option to run")
|
||||
for item in items:
|
||||
if "stress" in item.keywords:
|
||||
item.add_marker(skip_stress)
|
||||
|
Reference in New Issue
Block a user