summaryrefslogtreecommitdiff
path: root/sphinx/testing/restructuredtext.py
diff options
context:
space:
mode:
Diffstat (limited to 'sphinx/testing/restructuredtext.py')
-rw-r--r--sphinx/testing/restructuredtext.py11
1 files changed, 3 insertions, 8 deletions
diff --git a/sphinx/testing/restructuredtext.py b/sphinx/testing/restructuredtext.py
index 8bf1c041e..1da8d9a60 100644
--- a/sphinx/testing/restructuredtext.py
+++ b/sphinx/testing/restructuredtext.py
@@ -8,21 +8,16 @@
from os import path
+from docutils import nodes
from docutils.core import publish_doctree
+from sphinx.application import Sphinx
from sphinx.io import SphinxStandaloneReader
from sphinx.parsers import RSTParser
from sphinx.util.docutils import sphinx_domains
-if False:
- # For type annotation
- from docutils import nodes # NOQA
- from sphinx.application import Sphinx # NOQA
-
-
-def parse(app, text, docname='index'):
- # type: (Sphinx, str, str) -> nodes.document
+def parse(app: Sphinx, text: str, docname: str = 'index') -> nodes.document:
"""Parse a string as reStructuredText with Sphinx application."""
try:
app.env.temp_data['docname'] = docname