Skip to content

Commit

Permalink
Clarify test error rmessage.
Browse files Browse the repository at this point in the history
And precompute the delta-time as pytest's:
> assert (1728139272.6514266 - 1728139262.6307526) < 5

Is not super useful to know how long the timeout was.

In particular it allos us to see in ipykernels' main branch that the
delta is >=10s, so that the interrupt call is not properly handled.
  • Loading branch information
Carreau committed Oct 15, 2024
1 parent f9fc2f6 commit 0d321fd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions spyder_kernels/console/tests/test_console_kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -1314,13 +1314,17 @@ def test_interrupt():
kernel_comm.remote_call().raise_interrupt_signal()
# Wait for shell message
while True:
assert time.time() - t0 < 5
delta = time.time() - t0
assert delta < 5
msg = client.get_shell_msg(timeout=TIMEOUT)
if msg["parent_header"].get("msg_id") != msg_id:
# not from my request
continue
break
assert time.time() - t0 < 5
delta = time.time() - t0
assert (
delta < 5
), "10 second long call should have been interupted, interrupt signal was likely misshandled"


def test_enter_debug_after_interruption():
Expand Down

0 comments on commit 0d321fd

Please sign in to comment.