livery.workshop._pytest_console¶
livery.workshop._pytest_console ¶
Name a child that ended on a console control event, and who shared the console.
Registered through livery-workshop's pytest11 entry point, so every
pytest this venv starts carries it. A process on Windows that receives
a console control event, Ctrl+C or Ctrl+Break or the console closing,
exits with STATUS_CONTROL_C_EXIT (0xC000013A, 3221225786 as
Python reads it). A test whose git child ends that way fails with the
bare number, and one sighting in a run of thousands of tests leaves
nothing to bisect. When a failed test's exception carries that status,
this plugin adds a section to the failure report: the command, the
process and its worker, the run, every control event this process's
own handler saw in the session with the time it arrived, and every
process attached to the console at the moment of the report, by id
and image name. On another platform the section says so and carries
what it can.
The handler this plugin installs records events and passes them on: it returns false to the console, so the interpreter's own handling is untouched.
Functions:
| Name | Description |
|---|---|
control_exit |
Whether code is |
exit_codes |
Every exit code a failure carries: a called process's, down its cause chain. |
pytest_configure |
Install the recording handler on Windows; elsewhere there is no console. |
console_processes |
The processes attached to this console, by id and image; None off Windows. |
diagnosis |
The section's text for a failure that carries the control-exit status. |
pytest_runtest_makereport |
Add the section to a failed report whose exception carries the status. |
Attributes:
| Name | Type | Description |
|---|---|---|
STATUS_CONTROL_C_EXIT |
The NTSTATUS a process exits with after a console control event. |
STATUS_CONTROL_C_EXIT
module-attribute
¶
The NTSTATUS a process exits with after a console control event.
control_exit ¶
Whether code is STATUS_CONTROL_C_EXIT, as Python or the shell spells it.
exit_codes ¶
exit_codes(error: BaseException | None) -> list[int]
Every exit code a failure carries: a called process's, down its cause chain.
Source code in packages/workshop/src/livery/workshop/_pytest_console.py
pytest_configure ¶
Install the recording handler on Windows; elsewhere there is no console.
console_processes ¶
The processes attached to this console, by id and image; None off Windows.
Source code in packages/workshop/src/livery/workshop/_pytest_console.py
diagnosis ¶
diagnosis(error: BaseException | None) -> str
The section's text for a failure that carries the control-exit status.
Source code in packages/workshop/src/livery/workshop/_pytest_console.py
pytest_runtest_makereport ¶
pytest_runtest_makereport(item: Item, call: CallInfo[None]) -> Any
Add the section to a failed report whose exception carries the status.