astero.testing¶
Programs exercising every declared position.
astero.testing.generate ¶
Programs that exercise every declared role.
The grammar says which positions bind, which declare, and which open a scope. That list is also a coverage obligation: each one is a case the derivations have to get right, and the standard library is not guaranteed to contain a good example of each.
So the generator is driven by the declaration rather than by a hand-written
list of interesting programs. Ask the grammar for its binding positions, emit a
program per position, and a role added to the declaration is fuzzed from the
moment it is declared. missing_coverage is what turns that from a claim into
a check.
Each snippet is ordinary Python source, so the oracles are CPython's own:
ast.parse for contexts, symtable for scopes.
missing_coverage ¶
Declared positions with no snippet exercising them.
The point of the whole module: a role added to the declaration and not to the corpus shows up here rather than going untested.
scopes is a layer table, astero.python.SCOPES or one like it. Only its keys
are read; the annotation said Mapping[str, Scope], which no caller has
ever passed.
combinations ¶
Snippets nested inside one another, to reach the interactions.
A binding position inside a comprehension inside a class body is where the hand-written binders in the corpus go wrong, and no single snippet gets there. The generator is seeded, so a failure is reproducible.