Skip to content

Commit de5d4bd

Browse files
committed
FIX: Avoid importing test feature during test collection
1 parent 27136a4 commit de5d4bd

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

nibabel/__future__/tests/conftest.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import pytest
2+
from packaging.version import Version
3+
4+
if Version(pytest.__version__) >= Version("7"):
5+
def pytest_ignore_collect(collection_path):
6+
return collection_path.name == "example_feature.py"
7+
else:
8+
def pytest_ignore_collect(path):
9+
return path.basename == "example_feature.py"

0 commit comments

Comments
 (0)