From 4e74541163b3283ca5c19e908f83cf2b03bc6190 Mon Sep 17 00:00:00 2001 From: Thomas Hisch Date: Sat, 14 May 2022 03:43:40 +0200 Subject: [PATCH] Don't use MockAwareDocTestFinder in py3.10 Due to a fix in the python stdlib the MockAwareDocTestFinder is no longer needed in py3.10 Related: #27 --- pytest_sphinx.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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,