-
Notifications
You must be signed in to change notification settings - Fork 2
/
conftest.py
28 lines (20 loc) · 885 Bytes
/
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
import pytest
from minivirt import qemu
def pytest_addoption(parser):
parser.addoption('--runslow', action='store_true', help='Run slow tests')
def pytest_configure(config):
config.addinivalue_line('markers', 'slow: mark test as slow to run')
config.addinivalue_line('markers', 'arch: run only on these architectures')
def pytest_collection_modifyitems(config, items):
for item in items:
if 'slow' in item.keywords:
if not config.getoption('--runslow'):
item.add_marker(
pytest.mark.skip(reason='need --runslow option to run')
)
if 'arch' in item.keywords:
supported = list(item.keywords['arch'].args)
if qemu.arch not in supported:
item.add_marker(
pytest.mark.skip(reason=f'only runs on {supported}')
)