本文整理匯總了Python中mu.modes.python3.PythonMode.on_kernel_stop方法的典型用法代碼示例。如果您正苦於以下問題:Python PythonMode.on_kernel_stop方法的具體用法?Python PythonMode.on_kernel_stop怎麽用?Python PythonMode.on_kernel_stop使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類mu.modes.python3.PythonMode
的用法示例。
在下文中一共展示了PythonMode.on_kernel_stop方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_python_on_kernel_stop
# 需要導入模塊: from mu.modes.python3 import PythonMode [as 別名]
# 或者: from mu.modes.python3.PythonMode import on_kernel_stop [as 別名]
def test_python_on_kernel_stop():
"""
Ensure everything REPL based is cleaned up when this handler is called.
"""
editor = mock.MagicMock()
view = mock.MagicMock()
view.button_bar.slots = {
'repl': mock.MagicMock(),
}
pm = PythonMode(editor, view)
pm.on_kernel_stop()
assert pm.repl_kernel_manager is None
view.button_bar.slots['repl'].setEnabled.assert_called_once_with(True)
editor.show_status_message.assert_called_once_with('REPL stopped.')
assert pm.kernel_runner is None