mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-16 10:37:52 +08:00
Add py__doc__ as a better approach to docstrings.
This commit is contained in:
@@ -129,11 +129,27 @@ def test_completion_docstring():
|
||||
docstr('import jedi\njedi.Scr', cleandoc(Script.__doc__))
|
||||
|
||||
docstr('abcd=3;abcd', '')
|
||||
docstr('"hello"\nabcd=3\nabcd', 'hello')
|
||||
# It works with a ; as well.
|
||||
docstr('"hello"\nabcd=3;abcd', 'hello')
|
||||
docstr('"hello"\nabcd=3\nabcd', '')
|
||||
docstr(dedent('''
|
||||
def x():
|
||||
"hello"
|
||||
0
|
||||
x'''),
|
||||
'hello'
|
||||
)
|
||||
docstr(dedent('''
|
||||
def x():
|
||||
"hello";0
|
||||
x'''),
|
||||
'hello'
|
||||
)
|
||||
# Shouldn't work with a tuple.
|
||||
docstr('"hello",0\nabcd=3\nabcd', '')
|
||||
docstr(dedent('''
|
||||
def x():
|
||||
"hello",0
|
||||
x'''),
|
||||
''
|
||||
)
|
||||
|
||||
|
||||
def test_completion_params():
|
||||
|
||||
@@ -53,7 +53,7 @@ def test_doc():
|
||||
just a Jedi API definition.
|
||||
"""
|
||||
obj = compiled.CompiledObject(_evaluator(), ''.__getnewargs__)
|
||||
assert obj.doc == ''
|
||||
assert obj.py__doc__() == ''
|
||||
|
||||
|
||||
def test_string_literals():
|
||||
|
||||
Reference in New Issue
Block a user