mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix #4156: failed to parse class comment
This commit is contained in:
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user