summaryrefslogtreecommitdiff
path: root/tests/test_pycode_parser.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_pycode_parser.py')
-rw-r--r--tests/test_pycode_parser.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/test_pycode_parser.py b/tests/test_pycode_parser.py
index b8bece84e..0bf505a33 100644
--- a/tests/test_pycode_parser.py
+++ b/tests/test_pycode_parser.py
@@ -99,12 +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',
+ ('', 'd'): 'int'}
assert parser.definitions == {}