diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-02-01 13:38:34 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-02-03 01:19:05 +0900 |
commit | 92cb828f14afb61645ea807f456d9ba9f0f8d0e0 (patch) | |
tree | 272d27c61e4001c3c005070d10998165085a7eb6 /tests/test_pycode_parser.py | |
parent | 20126433d6598a53eee0067bfb0ae641128b864f (diff) | |
download | sphinx-git-92cb828f14afb61645ea807f456d9ba9f0f8d0e0.tar.gz |
autodoc: Support type_comment styled type annotation for variables
Diffstat (limited to 'tests/test_pycode_parser.py')
-rw-r--r-- | tests/test_pycode_parser.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/test_pycode_parser.py b/tests/test_pycode_parser.py index 6cc18bcb6..0bf505a33 100644 --- a/tests/test_pycode_parser.py +++ b/tests/test_pycode_parser.py @@ -99,15 +99,19 @@ def test_annotated_assignment_py36(): source = ('a: str = "Sphinx" #: comment\n' 'b: int = 1\n' '"""string on next line"""\n' - 'c: int #: comment') + 'c: int #: comment\n' + 'd = 1 # type: int\n' + '"""string on next line"""\n') parser = Parser(source) parser.parse() assert parser.comments == {('', 'a'): 'comment', ('', 'b'): 'string on next line', - ('', 'c'): 'comment'} + ('', 'c'): 'comment', + ('', 'd'): 'string on next line'} assert parser.annotations == {('', 'a'): 'str', ('', 'b'): 'int', - ('', 'c'): 'int'} + ('', 'c'): 'int', + ('', 'd'): 'int'} assert parser.definitions == {} |