Add py__doc__ as a better approach to docstrings.

This commit is contained in:
Dave Halter
2017-04-20 09:45:12 +02:00
parent b4631d6dd4
commit 7ca62578e1
6 changed files with 56 additions and 38 deletions

View File

@@ -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():