diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2017-10-21 13:45:33 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-21 13:45:33 +0900 |
commit | f224f3ca25a3b22d549fcea2e7b26a2ee5a566cc (patch) | |
tree | 3bd1b0b4ce0191934ec0004c9c5e82a0cd38c7ad /tests/test_pycode_parser.py | |
parent | 134f3b18842b4ca09c88659b77ce1116a24027e2 (diff) | |
parent | 7aab8c3b07653cceeea534bf536eb8bee2bb7f61 (diff) | |
download | sphinx-git-f224f3ca25a3b22d549fcea2e7b26a2ee5a566cc.tar.gz |
Merge pull request #4157 from tk0miya/4156_parse_class_comment
Fix #4156: failed to parse class comment
Diffstat (limited to 'tests/test_pycode_parser.py')
-rw-r--r-- | tests/test_pycode_parser.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test_pycode_parser.py b/tests/test_pycode_parser.py index d794376fa..b9327999b 100644 --- a/tests/test_pycode_parser.py +++ b/tests/test_pycode_parser.py @@ -246,6 +246,18 @@ def test_nested_class(): 'Foo.Bar.attr2': 3} +def test_class_comment(): + source = ('import logging\n' + 'logger = logging.getLogger(__name__)\n' + '\n' + 'class Foo(object):\n' + ' """Bar"""\n') + parser = Parser(source) + parser.parse() + assert parser.comments == {} + assert parser.definitions == {'Foo': ('class', 4, 5)} + + def test_comment_picker_multiline_string(): source = ('class Foo(object):\n' ' a = None\n' |