forked from cctbx/dxtbx
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconftest.py
More file actions
33 lines (26 loc) · 975 Bytes
/
conftest.py
File metadata and controls
33 lines (26 loc) · 975 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#
# See https://github.com/dials/dials/wiki/pytest for documentation on how to
# write and run pytest tests, and an overview of the available features.
#
from __future__ import annotations
import pytest
collect_ignore = []
def pytest_addoption(parser):
"""Add '--regression' options to pytest."""
try:
parser.addoption(
"--regression",
action="store_true",
default=False,
help="run (time-intensive) regression tests",
)
except ValueError:
# Thrown in case the command line option is already defined
pass
def pytest_collection_modifyitems(config, items):
"""Tests marked as regression are only run with --regression."""
if not config.getoption("--regression"):
skip_regression = pytest.mark.skip(reason="Test only runs with --regression")
for item in items:
if "regression" in item.keywords:
item.add_marker(skip_regression)