Skip to content

A run cut short by Ctrl-C

What pytest does when a test raises KeyboardInterrupt.

The second test raises KeyboardInterrupt, which is what pressing Ctrl-C during a run amounts to. pytest stops immediately: the third test is never collected for running, and the session unwinds through pytest_keyboard_interrupt before reaching pytest_sessionfinish.

The flow is shorter than a normal run, and deliberately so - this page is here to show the shape of an abandoned session, not a healthy one.

Latest pytest - or pick a flow below.

Distinct flows

52 captured releases produce 8 distinct flows.

Flow Releases
pytest 8.1.1 - 9.1.1 20
pytest 8.0.0 - 8.0.2 3
pytest 7.3.2 - 7.4.4 6
pytest 7.1.0 - 7.3.1 9
pytest 7.0.0 - 7.0.1 2
pytest 6.2.0 - 6.2.5 6
pytest 6.1.0 - 6.1.2 3
pytest 6.0.0 - 6.0.2 3