mirror of
https://github.com/huggingface/text-generation-inference.git
synced 2025-09-11 20:34:54 +00:00
Add pytest release marker
Annotate a test with `@pytest.mark.release` and it only gets run with `pytest integration-tests --release`.
This commit is contained in:
parent
b69f078041
commit
32a5ea3282
@ -37,6 +37,26 @@ DOCKER_VOLUME = os.getenv("DOCKER_VOLUME", "/data")
|
|||||||
DOCKER_DEVICES = os.getenv("DOCKER_DEVICES")
|
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):
|
class ResponseComparator(JSONSnapshotExtension):
|
||||||
rtol = 0.2
|
rtol = 0.2
|
||||||
ignore_logprob = False
|
ignore_logprob = False
|
||||||
|
Loading…
Reference in New Issue
Block a user