Skip to content

Commit

Permalink
Adapt to incompatible interface change in pytest-8.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
twmr committed Apr 1, 2024
1 parent f2b1eea commit 485779c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/pytest_sphinx.py
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,9 @@ def collect(self) -> Iterator[_pytest.doctest.DoctestItem]:
class SphinxDoctestModule(pytest.Module):
def collect(self) -> Iterator[_pytest.doctest.DoctestItem]:
try:
module = import_path(self.path, root=self.config.rootpath)
module = import_path(
self.path, root=self.config.rootpath, consider_namespace_packages=False
)
except ImportError:
if self.config.getvalue("doctest_ignore_import_errors"):
pytest.skip("unable to import module %r" % self.path)
Expand Down

0 comments on commit 485779c

Please sign in to comment.