Skip to content

Commit

Permalink
FIX: Avoid importing __future__ features during test collection
Browse files Browse the repository at this point in the history
  • Loading branch information
effigies committed Feb 14, 2022
1 parent 27136a4 commit 81ed771
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions nibabel/__future__/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import pytest
from packaging.version import Version
from . import future_flags

if Version(pytest.__version__) >= Version("7"):
def pytest_ignore_collect(collection_path):
if collection_path.name == "example_feature.py":
return True
if collection_path.stem in future_flags:
return True
else:
def pytest_ignore_collect(path):
if path.basename == "example_feature.py":
return True
if path.basename[:-3] in future_flags:
return True

0 comments on commit 81ed771

Please sign in to comment.