summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeewis <keewis@posteo.de>2020-08-04 11:30:14 +0200
committerKeewis <keewis@posteo.de>2020-08-04 11:30:14 +0200
commitfa760c326a1a96e9fe9f373b9b94757dd636e12f (patch)
tree3ba9ef61ec9f56c278968fcd1f23a76ed62cd37d
parent697fc8b16c211dc8515afd3f6df8d7c3baca469d (diff)
downloadsphinx-git-fa760c326a1a96e9fe9f373b9b94757dd636e12f.tar.gz
move the translations to a named variable
-rw-r--r--tests/test_ext_napoleon_docstring.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/tests/test_ext_napoleon_docstring.py b/tests/test_ext_napoleon_docstring.py
index 017737387..991e5a232 100644
--- a/tests/test_ext_napoleon_docstring.py
+++ b/tests/test_ext_napoleon_docstring.py
@@ -1687,12 +1687,11 @@ ndarray
:Yields: :term:`scalar` or :class:`array-like <numpy.ndarray>` -- The result of the computation
""")
- config = Config(
- napoleon_type_aliases={
- "scalar": ":term:`scalar`",
- "array-like": ":class:`array-like <numpy.ndarray>`",
- }
- )
+ translations = {
+ "scalar": ":term:`scalar`",
+ "array-like": ":class:`array-like <numpy.ndarray>`",
+ }
+ config = Config(napoleon_type_aliases=translations)
app = mock.Mock()
actual = str(NumpyDocstring(docstring, config, app, "method"))
self.assertEqual(expected, actual)