Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
1.3.0 (unreleased)
==================

- Compatibility with pytest 8.2. [#241]

1.2.0 (2024-03-04)
==================

Expand Down
11 changes: 8 additions & 3 deletions pytest_doctestplus/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@
PYTEST_GT_5 = _pytest_version > Version('5.9.9')
PYTEST_GE_5_4 = _pytest_version >= Version('5.4')
PYTEST_GE_7_0 = _pytest_version >= Version('7.0')
PYTEST_GE_8_0 = any([_pytest_version.is_devrelease,
PYTEST_GE_8_0 = _pytest_version >= Version('8.0')
PYTEST_GE_8_2 = any([_pytest_version.is_devrelease,
_pytest_version.is_prerelease,
_pytest_version >= Version('8.0')])
_pytest_version >= Version('8.2')])

comment_characters = {
'.txt': '#',
Expand Down Expand Up @@ -264,7 +265,11 @@ def collect(self):
from _pytest.pathlib import import_path
mode = self.config.getoption("importmode")

if PYTEST_GE_7_0:
if PYTEST_GE_8_2:
consider_namespace_packages = self.config.getini("consider_namespace_packages")
module = import_path(fspath, mode=mode, root=self.config.rootpath,
consider_namespace_packages=consider_namespace_packages)
elif PYTEST_GE_7_0:
module = import_path(fspath, mode=mode, root=self.config.rootpath)
elif PYTEST_GT_5:
module = import_path(fspath, mode=mode)
Expand Down