Skip to content

Commit

Permalink
MAINT: fix pytest 8.0dev compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
bsipocz committed Aug 10, 2023
1 parent a893bb4 commit 649df32
Showing 1 changed file with 8 additions and 3 deletions.
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

0 comments on commit 649df32

Please sign in to comment.