diff --git a/brian2/conftest.py b/brian2/conftest.py index 1c6f25949..fa1b0fbf7 100644 --- a/brian2/conftest.py +++ b/brian2/conftest.py @@ -14,12 +14,12 @@ from brian2.units import ms -def pytest_ignore_collect(path, config): +def pytest_ignore_collect(collection_path, config): if config.option.doctestmodules: - if "tests" in str(path): + if "tests" in collection_path.parts: return True # Ignore tests package for doctests # Do not test brian2.hears bridge (needs Brian1) - if str(path).endswith("hears.py"): + if collection_path.name == "hears.py": return True diff --git a/pyproject.toml b/pyproject.toml index aab005e37..a2b31ed7c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,7 +31,7 @@ classifiers = [ ] [project.optional-dependencies] -test = ['pytest', 'pytest-xdist>=1.22.3', 'pytest-cov>=2.0', 'pytest-timeout'] +test = ['pytest>=8', 'pytest-xdist>=1.22.3', 'pytest-cov>=2.0', 'pytest-timeout'] docs = ['sphinx>=7', 'ipython>=5', 'sphinx-tabs'] [project.urls]