summaryrefslogtreecommitdiff
path: root/sphinx/testing/util.py
diff options
context:
space:
mode:
Diffstat (limited to 'sphinx/testing/util.py')
-rw-r--r--sphinx/testing/util.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/sphinx/testing/util.py b/sphinx/testing/util.py
index 4c18d1c0c..cd2073aaa 100644
--- a/sphinx/testing/util.py
+++ b/sphinx/testing/util.py
@@ -20,7 +20,7 @@ from six import string_types
from sphinx import application, locale
from sphinx.builders.latex import LaTeXBuilder
-from sphinx.ext.autodoc import AutoDirective
+from sphinx.deprecation import RemovedInSphinx40Warning
from sphinx.pycode import ModuleAnalyzer
from sphinx.testing.path import path
from sphinx.util.osutil import relpath
@@ -93,7 +93,7 @@ def etree_parse(path):
return ElementTree.parse(path) # type: ignore
-class Struct(object):
+class Struct:
def __init__(self, **kwds):
# type: (Any) -> None
self.__dict__.update(kwds)
@@ -146,7 +146,6 @@ class SphinxTestApp(application.Sphinx):
def cleanup(self, doctrees=False):
# type: (bool) -> None
- AutoDirective._registry.clear()
ModuleAnalyzer.cache.clear()
LaTeXBuilder.usepackages = []
locale.translators.clear()
@@ -165,7 +164,7 @@ class SphinxTestApp(application.Sphinx):
return '<%s buildername=%r>' % (self.__class__.__name__, self.builder.name)
-class SphinxTestAppWrapperForSkipBuilding(object):
+class SphinxTestAppWrapperForSkipBuilding:
"""
This class is a wrapper for SphinxTestApp to speed up the test by skipping
`app.build` process if it is already built and there is even one output
@@ -193,6 +192,8 @@ _unicode_literals_re = re.compile(r'u(".*?")|u(\'.*?\')')
def remove_unicode_literals(s):
# type: (unicode) -> unicode
+ warnings.warn('remove_unicode_literals() is deprecated.',
+ RemovedInSphinx40Warning)
return _unicode_literals_re.sub(lambda x: x.group(1) or x.group(2), s)