Add more crosscheck tests
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user