summaryrefslogtreecommitdiff
path: root/tests/test_ext_napoleon_docstring.py
diff options
context:
space:
mode:
authorKeewis <keewis@posteo.de>2020-07-21 12:42:57 +0200
committerKeewis <keewis@posteo.de>2020-07-21 17:13:41 +0200
commitae35f81d3d8c7579fc81eaa11f71ba3a17e27722 (patch)
tree8c9bf3520fd1ce356ab4e122b6f7450164a73806 /tests/test_ext_napoleon_docstring.py
parent9b425606e7be92c048e1b08b41562c296fadc56c (diff)
downloadsphinx-git-ae35f81d3d8c7579fc81eaa11f71ba3a17e27722.tar.gz
allow mapping to a long name
Diffstat (limited to 'tests/test_ext_napoleon_docstring.py')
-rw-r--r--tests/test_ext_napoleon_docstring.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/test_ext_napoleon_docstring.py b/tests/test_ext_napoleon_docstring.py
index 64fce5aa4..56812d193 100644
--- a/tests/test_ext_napoleon_docstring.py
+++ b/tests/test_ext_napoleon_docstring.py
@@ -2066,6 +2066,10 @@ definition_after_normal_text : int
self.assertEqual(expected, actual)
def test_convert_numpy_type_spec(self):
+ translations = {
+ "DataFrame": "pandas.DataFrame",
+ }
+
specs = (
"",
"optional",
@@ -2073,6 +2077,7 @@ definition_after_normal_text : int
"int or float or None, default: None",
'{"F", "C", "N"}',
"{'F', 'C', 'N'}, default: 'N'",
+ "DataFrame, optional",
)
converted = (
@@ -2082,10 +2087,11 @@ definition_after_normal_text : int
":class:`int` or :class:`float` or :obj:`None`, *default*: :obj:`None`",
'``{"F", "C", "N"}``',
"``{'F', 'C', 'N'}``, *default*: ``'N'``",
+ ":class:`pandas.DataFrame`, *optional*",
)
for spec, expected in zip(specs, converted):
- actual = _convert_numpy_type_spec(spec)
+ actual = _convert_numpy_type_spec(spec, translations=translations)
self.assertEqual(expected, actual)
def test_parameter_types(self):