summaryrefslogtreecommitdiff
path: root/tests/test_ext_napoleon_docstring.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2020-10-30 00:49:59 +0900
committerGitHub <noreply@github.com>2020-10-30 00:49:59 +0900
commit921f0979060f209542a266ea79a5664e54160033 (patch)
treec58ae52fe5e2e884e889774f3e0bb72d9f25ffdd /tests/test_ext_napoleon_docstring.py
parent293dced4d4213d924310160a112d0907e02f8059 (diff)
parent95c861facb752daeacca09a118f48f323ffcea32 (diff)
downloadsphinx-git-921f0979060f209542a266ea79a5664e54160033.tar.gz
Merge pull request #8051 from keewis/fix-see_also
use the obj role for all See Also items
Diffstat (limited to 'tests/test_ext_napoleon_docstring.py')
-rw-r--r--tests/test_ext_napoleon_docstring.py33
1 files changed, 31 insertions, 2 deletions
diff --git a/tests/test_ext_napoleon_docstring.py b/tests/test_ext_napoleon_docstring.py
index bbc075edd..d515a5c3f 100644
--- a/tests/test_ext_napoleon_docstring.py
+++ b/tests/test_ext_napoleon_docstring.py
@@ -1455,9 +1455,38 @@ numpy.multivariate_normal(mean, cov, shape=None, spam=None)
.. seealso::
- :meth:`some`, :meth:`other`, :meth:`funcs`
+ :obj:`some`, :obj:`other`, :obj:`funcs`
+ \n\
+ :obj:`otherfunc`
+ relationship
+"""
+ self.assertEqual(expected, actual)
+
+ docstring = """\
+numpy.multivariate_normal(mean, cov, shape=None, spam=None)
+
+See Also
+--------
+some, other, :func:`funcs`
+otherfunc : relationship
+
+"""
+ translations = {
+ "other": "MyClass.other",
+ "otherfunc": ":func:`~my_package.otherfunc`",
+ }
+ config = Config(napoleon_type_aliases=translations)
+ app = mock.Mock()
+ actual = str(NumpyDocstring(docstring, config, app, "method"))
+
+ expected = """\
+numpy.multivariate_normal(mean, cov, shape=None, spam=None)
+
+.. seealso::
+
+ :obj:`some`, :obj:`MyClass.other`, :func:`funcs`
\n\
- :meth:`otherfunc`
+ :func:`~my_package.otherfunc`
relationship
"""
self.assertEqual(expected, actual)