@cwd_at('.')
def test_completion_docstring():
 def docstr(src, result):
  c = Script(src).completions()[0]
  assert (c.docstring(raw=True, fast=False) == cleandoc(result))
 c = Script('import jedi\njed').completions()[0]
 assert (c.docstring(fast=False) == cleandoc(jedi_doc))
 docstr('import jedi\njedi.Scr', cleandoc(Script.__doc__))
 docstr('abcd=3;abcd', '')
 docstr('"hello"\nabcd=3\nabcd', 'hello')
 docstr('"hello"\nabcd=3;abcd', 'hello')
 docstr('"hello",0\nabcd=3\nabcd', '')

@ cwd_at ( '.' ) def test_completion_docstring ( ) : def docstr ( src , result ) : c = Script ( src ) . completions ( ) [ 0 ] assert ( c . docstring ( raw = True , fast = False ) == cleandoc ( result ) ) c = Script ( 'import jedi\njed' ) . completions ( ) [ 0 ] assert ( c . docstring ( fast = False ) == cleandoc ( jedi_doc ) ) docstr ( 'import jedi\njedi.Scr' , cleandoc ( Script . __doc__ ) ) docstr ( 'abcd=3;abcd' , '' ) docstr ( '"hello"\nabcd=3\nabcd' , 'hello' ) docstr ( '"hello"\nabcd=3;abcd' , 'hello' ) docstr ( '"hello",0\nabcd=3\nabcd' , '' )
jedi should follow imports in certain conditions .