Skip to content

Commit 649df32

Browse files
committed
MAINT: fix pytest 8.0dev compatibility
1 parent a893bb4 commit 649df32

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

pytest_doctestplus/plugin.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@
2626
_pytest_version = Version(pytest.__version__)
2727
PYTEST_GT_5 = _pytest_version > Version('5.9.9')
2828
PYTEST_GE_5_4 = _pytest_version >= Version('5.4')
29-
PYTEST_GE_7_0 = any([_pytest_version.is_devrelease,
29+
PYTEST_GE_7_0 = _pytest_version >= Version('7.0')
30+
PYTEST_GE_8_0 = any([_pytest_version.is_devrelease,
3031
_pytest_version.is_prerelease,
31-
_pytest_version >= Version('7.0')])
32+
_pytest_version >= Version('8.0')])
3233

3334
comment_characters = {
3435
'.txt': '#',
@@ -507,7 +508,11 @@ def pytest_ignore_collect(self, path, config):
507508
Skip paths that match any of the doctest_norecursedirs patterns or
508509
if doctest_only is True then skip all regular test files (eg test_*.py).
509510
"""
510-
if PYTEST_GE_7_0:
511+
if PYTEST_GE_8_0:
512+
dirpath = Path(path).parent
513+
collect_ignore = config._getconftest_pathlist("collect_ignore",
514+
path=dirpath)
515+
elif PYTEST_GE_7_0:
511516
dirpath = Path(path).parent
512517
collect_ignore = config._getconftest_pathlist("collect_ignore",
513518
path=dirpath,

0 commit comments

Comments
 (0)