Pytest tally
pytest_tally
Tally pytest outcome lines (FAILED/ERROR/SKIPPED/...) into per-kind counts.
Stdlib-only helper: classify each line by its leading whitespace-stripped,
lower-cased first token. Unrecognised or malformed elements are routed to the
unknown bucket so the sum of all buckets always equals the input length.
tally_outcomes(lines)
Count pytest outcome lines per kind.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
lines
|
Iterable[object]
|
An iterable of outcome lines (typically pytest short-summary
lines such as |
required |
Returns:
| Type | Description |
|---|---|
dict[str, int]
|
A dict with the fixed keys |
dict[str, int]
|
(each always present, initialised to |
dict[str, int]
|
increments exactly one bucket, so the bucket sum equals the number of |
dict[str, int]
|
elements. |