livery.extensions.pytest._coverage¶
livery.extensions.pytest._coverage ¶
Reduce coverage.py's measurements to the line format the coverage extension reads.
While coverage is listed, the coverage extension asks its
coverage.measurers query which extension reduces each measurer's
data, and this extension answers for arcs, coverage.py's arcs, in
its [for.coverage] table (measurers). Arcs turns the data a
check leg's metered run left into one part per suite the leg ran, each
suite's arcs within its closure as its own tests and the code outside
every test reached them; and on a machine, the data its last run left
into one part of the whole run. A part is in the line format, version
3: per file, coverage.py's own analysis of it under the workspace's
.coveragerc. It holds the statements and the ones that ran, the
excluded lines, the statements written over several lines, each
branch of a line with more than one exit with the sentence that says
why it would not run, the functions and classes, and the tests that
reached each line wherever the data names a test: on a check leg a
suite's own tests and the code outside every test, on a machine every
context its run recorded. coverage.py reads no columns, so a part
holds no ranges. A branch the
source waives with # pragma: no branch counts as taken, as
coverage.py counts it, and is tagged waived.
coverage.py's parser reads each file once, however many suites name it, and says each branch's sentence once. Before a part is handed over, each file's numbers are checked against coverage.py's own analysis of the same data, and a file whose numbers differ refuses the reduction, naming the file.
Classes:
| Name | Description |
|---|---|
Arcs |
coverage.py's arcs, reduced to parts in the line format. |
Functions:
| Name | Description |
|---|---|
measurers |
Answer |
Attributes:
| Name | Type | Description |
|---|---|---|
MEASURER |
|
|
FORMAT |
|
|
DATA_FILE |
|
|
CONFIG_FILE |
|
|
METER |
|
|
WAIVED |
|
|
LEFT_UNIT |
|
Arcs ¶
coverage.py's arcs, reduced to parts in the line format.
Methods:
| Name | Description |
|---|---|
leg |
One part per unit, in the units' order, from the data a check leg left. |
left |
The part of the data coverage.py left at root; none when it left none. |
leg ¶
One part per unit, in the units' order, from the data a check leg left.
Each unit is {"unit": <its path>, "tests": <the prefix its
own tests' contexts start with>, "within": [<the path prefixes
of its closure>]}; a unit without within takes every
file. The leg's data files combine in memory, and a unit's part
holds the arcs of the files within its closure that its own
tests reached, each test's context its node id, and that the
code outside every test reached, import time's: those belong to
every suite whose closure holds their file. A file the data
names with no arc is in no unit's part. Where the leg recorded
any test's context, each part names the contexts that reached
each of its lines, the empty one for the code outside every
test, numbered in sorted order; the record renumbers them when
it stores the part.
Raises:
| Type | Description |
|---|---|
ValueError
|
when the leg left no data, naming the variable that arms the meter; when a unit names no path; or when a file's numbers differ from coverage.py's, naming it. |
Source code in packages/extensions/pytest/src/livery/extensions/pytest/_coverage.py
left ¶
The part of the data coverage.py left at root; none when it left none.
A file the data names outside root is no file of the workspace and is left out; one inside it that the checkout no longer has is in the part with an empty digest and nothing else, since its source cannot be read.
Raises:
| Type | Description |
|---|---|
ValueError
|
when a file's numbers differ from coverage.py's, naming it. |
Source code in packages/extensions/pytest/src/livery/extensions/pytest/_coverage.py
measurers ¶
Answer coverage.measurers: this extension reduces coverage.py's arcs.