-
Notifications
You must be signed in to change notification settings - Fork 10
/
conftest.py
43 lines (34 loc) · 1.15 KB
/
conftest.py
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
34
35
36
37
38
39
40
41
42
43
"""PyTest configuration."""
import pytest
collect_ignore_glob = [
"weldx/visualization/*.py",
]
@pytest.fixture(autouse=True)
def mock_rw_buffer_weldxfile(request, monkeypatch):
if not request.config.getoption("--weldx-file-rw-buffer"):
return
monkeypatch.setattr("weldx.asdf.util._USE_WELDX_FILE", True)
def pytest_addoption(parser):
parser.addoption(
"--runslow", action="store_true", default=False, help="run slow tests"
)
parser.addoption(
"--weldx-file-rw-buffer",
action="store_true",
default=False,
help="the read/write buffer functions use WeldxFile internally",
)
parser.addoption(
"--weldx-file-rw-buffer-disp-header",
action="store_true",
default=False,
help="invoke display header to provoke side effects",
)
def pytest_collection_modifyitems(config, items):
if config.getoption("--runslow"):
# --runslow given in cli: do not skip slow tests
return
skip_slow = pytest.mark.skip(reason="need --runslow option to run")
for item in items:
if "slow" in item.keywords:
item.add_marker(skip_slow)