diff --git a/pytest_sphinx.py b/pytest_sphinx.py index d3c6de3..d55cbc7 100644 --- a/pytest_sphinx.py +++ b/pytest_sphinx.py @@ -70,9 +70,9 @@ def _is_doctest(config, path, parent): _OPTION_SKIPIF_RE = re.compile(r':skipif:\s*([^\n\'"]*)$') _DIRECTIVE_RE = re.compile( - r"\s*\.\. (" - r"testcode|testoutput|testsetup|testcleanup|doctest" - r')::\s*([^\n\'"]*)$' + r"\s*\.\.\s" + r"(testcode|testoutput|testsetup|testcleanup|doctest)" + r'::\s*([^\n\'"]*)$', re.VERBOSE )