mirror of
https://github.com/davidhalter/jedi.git
synced 2026-10-16 01:12:42 +08:00
Attribute docstrings work now, fixes #138
This commit is contained in:
1 parent
4161bfc7f2
commit
fc785ce6ea
3 files changed
+42
-3
No files matched your search
@@ -52,3 +52,26 @@ def test_lambda(Script):
|
||||
)
|
||||
def test_help_no_returns(Script, code, kwargs):
|
||||
assert not Script(code).help(**kwargs)
|
||||
|
||||
|
||||
def test_attribute_docstrings(goto_or_help):
|
||||
code = dedent('''\
|
||||
class X:
|
||||
"ha"
|
||||
x = 3
|
||||
""" Yeah """
|
||||
y = 5
|
||||
"f g "
|
||||
z = lambda: 1
|
||||
''')
|
||||
|
||||
d, = goto_or_help(code + 'X.x')
|
||||
assert d.docstring() == 'Yeah '
|
||||
d, = goto_or_help(code + 'X().x')
|
||||
assert d.docstring() == 'Yeah '
|
||||
|
||||
d, = goto_or_help(code + 'X.y')
|
||||
assert d.docstring() == 'f g '
|
||||
|
||||
d, = goto_or_help(code + 'X.z')
|
||||
assert d.docstring() == ''
|
||||
Reference in new issue
Block a user