diff --git a/pytest_sphinx.py b/pytest_sphinx.py index 75d5674..54c8a56 100644 --- a/pytest_sphinx.py +++ b/pytest_sphinx.py @@ -520,7 +520,10 @@ def _find(self, tests, obj, name, module, source_lines, globs, seen): seen, ) - finder = MockAwareDocTestFinder(parser=SphinxDocTestParser()) + if sys.version_info < (3, 10): + finder = MockAwareDocTestFinder(parser=SphinxDocTestParser()) + else: + finder = doctest.DocTestFinder(parser=SphinxDocTestParser()) runner = SphinxDocTestRunner( verbose=0,