def METHOD_NAME(kernel):
    shell = ZMQInteractiveShell()
    with pytest.raises(RuntimeError):
        shell.enable_gui("tk")
    with warnings.catch_warnings():
        warnings.simplefilter("ignore", DeprecationWarning)
        shell.data_pub_class = MagicMock()  # type:ignore
        shell.data_pub
    shell.kernel = kernel
    shell.set_next_input("hi")
    assert shell.get_parent() is None
    if os.name == "posix":
        shell.system_piped("ls")
    else:
        shell.system_piped("dir")
    shell.ask_exit()