diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-06-04 00:18:30 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-06-04 00:18:30 +0900 |
commit | 068b9b5738b4d41a25e14d56d6f6b55f3bc8d443 (patch) | |
tree | f58f2d43d8a54545ae8a0c51ffe99c310864710d /tests/test_ext_napoleon_docstring.py | |
parent | 88a3548a8268d3b99f2d79db08fe65da7d691592 (diff) | |
parent | 9b45b00bd4cee7dad96b98cec0224f88a84ef40a (diff) | |
download | sphinx-git-068b9b5738b4d41a25e14d56d6f6b55f3bc8d443.tar.gz |
Merge branch '3.x'
Diffstat (limited to 'tests/test_ext_napoleon_docstring.py')
-rw-r--r-- | tests/test_ext_napoleon_docstring.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/test_ext_napoleon_docstring.py b/tests/test_ext_napoleon_docstring.py index 3027a4cb2..738fd6532 100644 --- a/tests/test_ext_napoleon_docstring.py +++ b/tests/test_ext_napoleon_docstring.py @@ -1399,11 +1399,32 @@ arg_ : type """ expected = """ +:ivar arg_: some description +:vartype arg_: type +""" + + config = Config(napoleon_use_ivar=True) + app = mock.Mock() + actual = str(NumpyDocstring(docstring, config, app, "class")) + + self.assertEqual(expected, actual) + + def test_underscore_in_attribute_strip_signature_backslash(self): + docstring = """ +Attributes +---------- + +arg_ : type + some description +""" + + expected = """ :ivar arg\\_: some description :vartype arg\\_: type """ config = Config(napoleon_use_ivar=True) + config.strip_signature_backslash = True app = mock.Mock() actual = str(NumpyDocstring(docstring, config, app, "class")) |