diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2017-10-19 00:10:46 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2017-10-19 00:10:46 +0900 |
commit | 1dfe978fcb60c4ba4c30914f5c2f4916123d91b3 (patch) | |
tree | 29b86ee7756b7b987dcf7cf8b3b039de2d0f78f2 /tests/test_pycode_parser.py | |
parent | 4fdcae05843cfc1be155620ade9dff10ab3e9853 (diff) | |
download | sphinx-git-1dfe978fcb60c4ba4c30914f5c2f4916123d91b3.tar.gz |
Support more complex starred asssignment case
Diffstat (limited to 'tests/test_pycode_parser.py')
-rw-r--r-- | tests/test_pycode_parser.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/test_pycode_parser.py b/tests/test_pycode_parser.py index 0ff4752b3..d794376fa 100644 --- a/tests/test_pycode_parser.py +++ b/tests/test_pycode_parser.py @@ -121,12 +121,17 @@ def test_complex_assignment(): @pytest.mark.skipif(PY2, reason='tests for py3 syntax') def test_complex_assignment_py3(): - source = 'a, *b, c = (1, 2, 3, 4) #: unpack assignment\n' + source = ('a, *b, c = (1, 2, 3, 4) #: unpack assignment\n' + 'd, *self.attr = (5, 6, 7) #: unpack assignment2\n' + 'e, *f[0] = (8, 9, 0) #: unpack assignment3\n' + ) parser = Parser(source) parser.parse() assert parser.comments == {('', 'a'): 'unpack assignment', ('', 'b'): 'unpack assignment', ('', 'c'): 'unpack assignment', + ('', 'd'): 'unpack assignment2', + ('', 'e'): 'unpack assignment3', } assert parser.definitions == {} |