Skip to content

Commit

Permalink
Add pytest release marker
Browse files Browse the repository at this point in the history
Annotate a test with `@pytest.mark.release` and it only gets run
with `pytest integration-tests --release`.
  • Loading branch information
danieldk committed Jun 25, 2024
1 parent b69f078 commit 32a5ea3
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions integration-tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,26 @@
DOCKER_DEVICES = os.getenv("DOCKER_DEVICES")


def pytest_addoption(parser):
parser.addoption(
"--release", action="store_true", default=False, help="run release tests"
)


def pytest_configure(config):
config.addinivalue_line("markers", "release: mark test as a release-only test")


def pytest_collection_modifyitems(config, items):
if config.getoption("--release"):
# --release given in cli: do not skip release tests
return
skip_release = pytest.mark.skip(reason="need --release option to run")
for item in items:
if "release" in item.keywords:
item.add_marker(skip_release)


class ResponseComparator(JSONSnapshotExtension):
rtol = 0.2
ignore_logprob = False
Expand Down

0 comments on commit 32a5ea3

Please sign in to comment.