summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorKeewis <keewis@posteo.de>2020-08-04 20:48:59 +0200
committerKeewis <keewis@posteo.de>2020-08-04 20:50:02 +0200
commite69724245135f152699d3f4a8b3c20992d9448ed (patch)
treed692ddce4b8878c0c4f248007410479467fe11c9 /tests
parentd9fb3bc25cecdcca78172e39b6b62723ba7f4dc5 (diff)
downloadsphinx-git-e69724245135f152699d3f4a8b3c20992d9448ed.tar.gz
fix the tests by falling back to a empty dict on AttributeError
Diffstat (limited to 'tests')
-rw-r--r--tests/test_ext_napoleon_docstring.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/test_ext_napoleon_docstring.py b/tests/test_ext_napoleon_docstring.py
index 56812d193..0894a9bff 100644
--- a/tests/test_ext_napoleon_docstring.py
+++ b/tests/test_ext_napoleon_docstring.py
@@ -1365,6 +1365,7 @@ otherfunc : relationship
config = Config()
app = mock.Mock()
+ app.builder.env = None
actual = str(NumpyDocstring(docstring, config, app, "method"))
expected = """\
@@ -1379,6 +1380,27 @@ numpy.multivariate_normal(mean, cov, shape=None, spam=None)
"""
self.assertEqual(expected, actual)
+ config = Config()
+ app = mock.Mock()
+ app.builder.env.intersphinx_inventory = {
+ "py:func": {"funcs": (), "otherfunc": ()},
+ "py:meth": {"some": (), "other": ()},
+ }
+ actual = str(NumpyDocstring(docstring, config, app, "method"))
+
+ expected = """\
+numpy.multivariate_normal(mean, cov, shape=None, spam=None)
+
+.. seealso::
+
+ :meth:`some`, :meth:`other`, :func:`funcs`
+ \n\
+ :func:`otherfunc`
+ relationship
+"""
+ self.assertEqual(expected, actual)
+
+
def test_colon_in_return_type(self):
docstring = """
Summary