def setup_terminal(qtbot_module, request): """Set up the Notebook plugin.""" class MainMock(QMainWindow): def __getattr__(self, attr): return Mock() def register_shortcut(self, *args, **kwargs): pass main = MainMock() CONF.register_plugin(TerminalPlugin) terminal = TerminalPlugin(main, CONF) terminal.update_font() qtbot_module.addWidget(terminal) qtbot_module.waitUntil(lambda: terminal.get_widget().server_is_ready(), timeout=TERM_UP) qtbot_module.wait(5000) terminal.create_new_term() terminal.get_widget().show() def teardown(): terminal.on_close() request.addfinalizer(teardown) return terminal
def setup_terminal(qtbot): """Set up the Notebook plugin.""" terminal = TerminalPlugin(None) qtbot.addWidget(terminal) terminal.create_new_term() terminal.show() return terminal
def setup_terminal(qtbot_module, request): """Set up the Notebook plugin.""" terminal = TerminalPlugin(None) qtbot_module.addWidget(terminal) qtbot_module.waitUntil(lambda: terminal.server_is_ready(), timeout=TERM_UP) qtbot_module.wait(5000) terminal.create_new_term() terminal.show() def teardown(): terminal.closing_plugin() request.addfinalizer(teardown) return terminal