Add more crosscheck tests

This commit is contained in:
Lucian Petrut
2026-09-09 10:16:31 +00:00
parent 6395daaf08
commit 2939caa4fc
4 changed files with 120 additions and 2 deletions
+29
View File
@@ -35,3 +35,32 @@ def lab() -> Iterator[LabEnv]:
def vddk() -> None:
"""Skip VDDK-backed tests when ``libvixDiskLib`` cannot be loaded."""
require_vddk()
def pytest_addoption(parser: pytest.Parser) -> None:
"""Add ``--runslow`` to opt in to long-running tests."""
parser.addoption(
"--runslow",
action="store_true",
default=False,
help="run tests marked as slow",
)
def pytest_configure(config: pytest.Config) -> None:
"""Register the ``slow`` marker."""
config.addinivalue_line(
"markers", "slow: long-running tests; enable with --runslow"
)
def pytest_collection_modifyitems(
config: pytest.Config, items: list[pytest.Item]
) -> None:
"""Skip ``slow`` tests unless ``--runslow`` was given."""
if config.getoption("--runslow"):
return
skip_slow = pytest.mark.skip(reason="need --runslow to run")
for item in items:
if "slow" in item.keywords:
item.add_marker(skip_slow)