-
Notifications
You must be signed in to change notification settings - Fork 64
/
Copy pathconftest.py
38 lines (34 loc) · 1.2 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
import pytest
def pytest_addoption(parser):
parser.addoption(
"--runvivado",
action="store_true",
default=False,
help="run tests that require vivado",
)
parser.addoption(
"--runlarge",
action="store_true",
default=False,
help="run tests that require large compute, these are not run by default in our CI",
)
parser.addoption(
"--rundev",
action="store_true",
default=False,
help="run tests that are in dev mode, they may not pass! These are not run by default in our CI",
)
def pytest_collection_modifyitems(config, items):
if config.getoption("--runvivado"):
# --runslow given in cli: do not skip slow tests
return
skip_vivado = pytest.mark.skip(reason="need --runvivado option to run")
skip_large = pytest.mark.skip(reason="need --runlarge option to run")
skip_dev = pytest.mark.skip(reason="need --rundev option to run")
for item in items:
if "vivado" in item.keywords:
item.add_marker(skip_vivado)
if "large" in item.keywords:
item.add_marker(skip_large)
if "dev" in item.keywords:
item.add_marker(skip_dev)