forked from G-Node/nixpy
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconftest.py
30 lines (22 loc) · 808 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
29
30
import pytest
import tempfile
from nixio.test.xcompat.compile import maketests
BINDIR = tempfile.mkdtemp(prefix="nixpy-tests-")
def pytest_addoption(parser):
parser.addoption("--nix-compat", action="store_true", default=False,
help=("Run nix compatibility tests "
"(requires NIX library)"))
@pytest.fixture
def bindir(request):
return BINDIR
def pytest_collection_modifyitems(config, items):
if config.getoption("--nix-compat"):
print("Compiling NIX compatibility tests")
maketests(BINDIR)
return
skip_compat = pytest.mark.skip(
reason="Use --nix-compat option to run compatibility tests"
)
for item in items:
if "compatibility" in item.keywords:
item.add_marker(skip_compat)