Skip to content

Commit

Permalink
Don't use MockAwareDocTestFinder in py3.10
Browse files Browse the repository at this point in the history
Due to a fix in the python stdlib the MockAwareDocTestFinder is no
longer needed in py3.10

Related: #27
  • Loading branch information
twmr committed May 14, 2022
1 parent 7654658 commit 4e74541
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pytest_sphinx.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 4e74541

Please sign in to comment.