Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
170 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,30 @@ | ||
import pytest | ||
import tempfile | ||
from nixio.test.xcompat.compile import maketests | ||
|
||
|
||
BINDIR = tempfile.mkdtemp(prefix="nixpy-tests-") | ||
|
||
|
||
def pytest_addoption(parser): | ||
parser.addoption("--force-compat", | ||
action="store_true", | ||
default=False, | ||
help=("Force cross-compatibility tests. " | ||
"Raise error instead of skipping.")) | ||
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.