diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2017-10-16 22:33:38 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2017-10-19 22:24:40 +0900 |
commit | 7aab8c3b07653cceeea534bf536eb8bee2bb7f61 (patch) | |
tree | 8291c706301d20d687d438e33fb31e5cf29f5620 /tests/test_pycode_parser.py | |
parent | 3369d9a03a9f1e173ed3b8281a50f4d52eb39fce (diff) | |
download | sphinx-git-7aab8c3b07653cceeea534bf536eb8bee2bb7f61.tar.gz |
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 cfea2ca00..8b7a945d4 100644 --- a/tests/test_pycode_parser.py +++ b/tests/test_pycode_parser.py @@ -226,6 +226,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' |