summaryrefslogtreecommitdiff
path: root/tests/test_ext_napoleon_docstring.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_ext_napoleon_docstring.py')
-rw-r--r--tests/test_ext_napoleon_docstring.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/test_ext_napoleon_docstring.py b/tests/test_ext_napoleon_docstring.py
index 47561fd71..acf000178 100644
--- a/tests/test_ext_napoleon_docstring.py
+++ b/tests/test_ext_napoleon_docstring.py
@@ -1167,6 +1167,30 @@ Sample class with PEP 526 annotations and google docstring
"""
self.assertEqual(expected, actual)
+ def test_preprocess_types(self):
+ docstring = """\
+Do as you please
+
+Yield:
+ str:Extended
+"""
+ actual = str(GoogleDocstring(docstring))
+ expected = """\
+Do as you please
+
+:Yields: *str* -- Extended
+"""
+ self.assertEqual(expected, actual)
+
+ config = Config(napoleon_preprocess_types=True)
+ actual = str(GoogleDocstring(docstring, config))
+ expected = """\
+Do as you please
+
+:Yields: :class:`str` -- Extended
+"""
+ self.assertEqual(expected, actual)
+
class NumpyDocstringTest(BaseDocstringTest):
docstrings = [(