Ejemplo n.º 1
0
def test_exception_in_threadsafe_call():
    # an exception in a threadsafe_call shouldn't crash the entire host
    msgs = []
    vim.async_call(lambda: [vim.eval("3"), undefined_variable])
    timer = Timer(0.5, lambda: vim.async_call(lambda: vim.stop_loop()))
    timer.start()
    vim.run_loop(None, None, err_cb=msgs.append)
    eq(len(msgs), 1)
    msgs[0].index('NameError')
    msgs[0].index('undefined_variable')
Ejemplo n.º 2
0
def test_exception_in_threadsafe_call():
    # an exception in a threadsafe_call shouldn't crash the entire host
    msgs = []
    vim.async_call(lambda: [vim.eval("3"), undefined_variable])
    timer = Timer(0.5, lambda: vim.async_call(lambda: vim.stop_loop()))
    timer.start()
    vim.run_loop(None, None, err_cb=msgs.append)
    eq(len(msgs), 1)
    msgs[0].index('NameError')
    msgs[0].index('undefined_variable')
Ejemplo n.º 3
0
def test_interrupt_from_another_thread():
    timer = Timer(0.5, lambda: vim.async_call(lambda: vim.stop_loop()))
    timer.start()
    eq(vim.next_message(), None)
Ejemplo n.º 4
0
def test_interrupt_from_another_thread():
    timer = Timer(0.5, lambda: vim.async_call(lambda: vim.stop_loop()))
    timer.start()
    eq(vim.next_message(), None)