livery.workshop._pytest_speed¶
livery.workshop._pytest_speed ¶
Sum each package's test time in a pytest run, for the runner to print.
Registered through livery-workshop's pytest11 entry point, so every
pytest this venv starts carries it. It acts only when the test runner
names a file in livery.workshop.SPEED_FILE_VARIABLE,
WORKSHOP_SPEED_FILE: every phase of every test adds its duration
to the sum of its package, the one livery.workshop.package_of
names, and the session's end writes the sums as JSON to that file,
from the controlling process alone under xdist. A pytest started
without the variable, the nested runs the workshop's own tests spawn
included, sums nothing and writes nothing.
Functions:
| Name | Description |
|---|---|
pytest_runtest_logreport |
Add the phase's duration to its package's sum. |
pytest_sessionfinish |
Write the sums to the named file, from the controlling process. |
pytest_runtest_logreport ¶
Add the phase's duration to its package's sum.
Source code in packages/workshop/src/livery/workshop/_pytest_speed.py
pytest_sessionfinish ¶
pytest_sessionfinish(session: Session, exitstatus: int | ExitCode) -> None
Write the sums to the named file, from the controlling process.