def setup_editor(qtbot):
 text = 'a = 1\nprint(a)\n\nx = 2'
 editorStack = EditorStack(None, [])
 editorStack.set_introspector(Mock())
 editorStack.set_find_widget(Mock())
 editorStack.set_io_actions(Mock(), Mock(), Mock(), Mock())
 finfo = editorStack.new('foo.py', 'utf-8', text)
 qtbot.addWidget(editorStack)
 return (editorStack, finfo.editor)

def setup_editor ( qtbot ) : text = 'a = 1\nprint(a)\n\nx = 2' editorStack = EditorStack ( None , [ ] ) editorStack . set_introspector ( Mock ( ) ) editorStack . set_find_widget ( Mock ( ) ) editorStack . set_io_actions ( Mock ( ) , Mock ( ) , Mock ( ) , Mock ( ) ) finfo = editorStack . new ( 'foo.py' , 'utf-8' , text ) qtbot . addWidget ( editorStack ) return ( editorStack , finfo . editor )
set up editorstack with codeeditor containing some python code .