Coverage for packages/workshop/src/livery/workshop/testing/__init__.py: 100%

Measured by coverage.py 7.16.2 on CPython 3.14 while the suites of tests, packages/workshop, packages/extensions/ty, packages/extensions/ruff, packages/extensions/python, packages/extensions/pytest, packages/extensions/pyrefly, packages/extensions/nanobind, packages/extensions/mypy, packages/extensions/mkdocstrings, packages/extensions/lfs, packages/extensions/docs, packages/extensions/cpp, packages/extensions/coverage, packages/extensions/conan, packages/extensions/cmake, packages/extensions/claude, packages/extensions/clang-tidy, packages/extensions/clang-format, packages/extensions/changelog, packages/extensions/basedpyright ran.

1"""What an extension's steps and categories are judged against: the conformance kit.
2
3An extension declares steps and category tables that the gate then
4relies on. The kit states what the gate relies on, one clause at a
5time, and judges an extension against it: a
6[livery.workshop.testing.Subject][] names the extension, the sets of
7extensions to probe it with and the steps it registers,
8each [livery.workshop.testing.Clause][] returns the
9[livery.workshop.testing.Violation][]s the subject commits, and
10[livery.workshop.testing.CLAUSES][] lists them in order. An extension's own
11suite runs every clause on its subject after the extension's
12registrations ran:
13
14```python
15import pytest
16
17from livery.workshop.testing import CLAUSES, Clause, Subject
18
19SUBJECT = Subject("acme.extension", sets=(("acme",),), steps=(...))
20
21
22@pytest.mark.parametrize("clause", CLAUSES, ids=lambda clause: clause.name)
23def test_the_extension_conforms(clause: Clause) -> None:
24 assert clause.judge(SUBJECT) == []
25```
26
27The workshop's own steps run the same clauses through
28[livery.workshop.testing.builtin_subject][], so the kit cannot drift
29from what the gate enforces.
30"""
31
32from __future__ import annotations(empty)
33
34from livery.workshop.testing._conformance import ((empty)
35 CLAUSES,
36 Clause,
37 Subject,
38 Violation,
39 builtin_subject,
40 judge,
41)
42
43__all__ = [(empty)
44 "CLAUSES",
45 "Clause",
46 "Subject",
47 "Violation",
48 "builtin_subject",
49 "judge",
50]