Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions pytest_doctestplus/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@
_pytest_version = Version(pytest.__version__)
PYTEST_GT_5 = _pytest_version > Version('5.9.9')
PYTEST_GE_5_4 = _pytest_version >= Version('5.4')
PYTEST_GE_7_0 = any([_pytest_version.is_devrelease,
PYTEST_GE_7_0 = _pytest_version >= Version('7.0')
PYTEST_GE_8_0 = any([_pytest_version.is_devrelease,
_pytest_version.is_prerelease,
_pytest_version >= Version('7.0')])
_pytest_version >= Version('8.0')])

comment_characters = {
'.txt': '#',
Expand Down Expand Up @@ -507,7 +508,11 @@ def pytest_ignore_collect(self, path, config):
Skip paths that match any of the doctest_norecursedirs patterns or
if doctest_only is True then skip all regular test files (eg test_*.py).
"""
if PYTEST_GE_7_0:
if PYTEST_GE_8_0:
dirpath = Path(path).parent
collect_ignore = config._getconftest_pathlist("collect_ignore",
path=dirpath)
elif PYTEST_GE_7_0:
dirpath = Path(path).parent
collect_ignore = config._getconftest_pathlist("collect_ignore",
path=dirpath,
Expand Down