From 08e243dc484bd7a76b546dd20030dcd0fea117b1 Mon Sep 17 00:00:00 2001 From: Mark Harfouche Date: Sun, 12 Aug 2018 00:15:28 -0400 Subject: [PATCH] Better round tripping for `See also` section Potential Fix for #188 --- numpydoc/docscrape.py | 2 +- numpydoc/tests/test_docscrape.py | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/numpydoc/docscrape.py b/numpydoc/docscrape.py index c5d9b0ec..35761692 100644 --- a/numpydoc/docscrape.py +++ b/numpydoc/docscrape.py @@ -442,7 +442,7 @@ def _str_see_also(self, func_role): elif func_role: link = ':%s:`%s`' % (func_role, func) else: - link = "`%s`_" % func + link = "%s" % func if desc or last_had_desc: out += [''] out += [link] diff --git a/numpydoc/tests/test_docscrape.py b/numpydoc/tests/test_docscrape.py index 902c3f1d..8b14493e 100644 --- a/numpydoc/tests/test_docscrape.py +++ b/numpydoc/tests/test_docscrape.py @@ -150,6 +150,11 @@ doc_yields = NumpyDocString(doc_yields_txt) +def test_to_docstring(): + # Simple test, this should just not raise + NumpyDocString(str(doc)) + + def test_signature(): assert doc['Signature'].startswith('numpy.multivariate_normal(') assert doc['Signature'].endswith('spam=None)') @@ -402,9 +407,9 @@ def test_str(): See Also -------- -`some`_, `other`_, `funcs`_ +some, other, funcs -`otherfunc`_ +otherfunc relationship Notes