livery.workshop._pytest_points¶
livery.workshop._pytest_points ¶
Select the tests a CI point runs: a test declares where it runs.
Registered through livery-workshop's pytest11 entry point, so every
pytest this venv starts carries it. A test without a marker runs at
the default points, the gate and the merge; only_at names the
points a test runs at and nowhere else; also_at adds points to
the default ones. The point comes from the job runner's environment
(WORKSHOP_POINT, set for every entry it spawns) or from
--workshop-point on the command line, and is the gate when
neither says. Tests outside the point's selection are deselected,
never skipped, so they leave no noise in the summary. A point beyond
the default ones that selects no test at all is green: the nightly
runs the whole check with its own tests selected in, and a workspace
that declares none has nothing to run there, which is not a failure.
Attributes:
| Name | Type | Description |
|---|---|---|
POINT_VARIABLE |
|
pytest_addoption ¶
Add --workshop-point, the point to select for on a local run.
Source code in packages/workshop/src/livery/workshop/_pytest_points.py
pytest_configure ¶
Register the two markers, so an unregistered-marker warning never fires.
Source code in packages/workshop/src/livery/workshop/_pytest_points.py
current_point ¶
current_point(config: Config) -> str
The point this run selects for: the option, else the environment, else gate.
Source code in packages/workshop/src/livery/workshop/_pytest_points.py
points_of ¶
The points item runs at, from its markers.
Raises:
| Type | Description |
|---|---|
UsageError
|
When a marker names no point or an unknown one. |
Source code in packages/workshop/src/livery/workshop/_pytest_points.py
pytest_collection_modifyitems ¶
pytest_collection_modifyitems(config: Config, items: list[Item]) -> None
Keep the tests of the current point; deselect the rest.
Source code in packages/workshop/src/livery/workshop/_pytest_points.py
pytest_sessionfinish ¶
pytest_sessionfinish(session: Session, exitstatus: int | ExitCode) -> None
Turn "no tests collected" into green at a point beyond the default ones.
pytest exits 5 when nothing ran. At the gate and the merge that stands, since a workspace without tests is not proved by an empty run. At the nightly or the release point an empty selection is the declared state: no test asked for the point, so the point has nothing to run and says so.