generate#
Canary Generate Pipeline#
This module implements the generateion lifecycle for converting generator output into fully resolved
test specs. The central orchestrator is the Generator object, which progresses through
validation, resolution, and finally hook-driven post-processing.
The canary_generate(generator) function coordinates the entire process using Pluggy hooks. Plugins
may observe or modify the generate at specific stages.
Flow Diagram#
The following diagram illustrates the full lifecycle:
Generator(s)
Produces [Un]resolved test specs
↓
Generator(generators)
Generate UnresolvedSpec from generator outputs
↓
canary_generate(generators)
• pluginmanager.hook.canary_generatestart()
• generator.run()
• validate(...)
• resolve(...)
• pluginmanager.hook.canary_generate_modifiyitems()
• pluginmanager.hook.canary_generate_report()
→ generator.resolved_specs()
- class Generator(generators: list[AbstractTestGenerator], workspace: Path, on_options: Iterable[str] = ())#
Bases:
object- run() list[ResolvedSpec]#
- validate(specs: list[UnresolvedSpec | ResolvedSpec]) None#
- resolve(specs: Sequence[UnresolvedSpec | ResolvedSpec]) list[ResolvedSpec]#
- generate_from_one(file: AbstractTestGenerator, on_options: list[str] | None) list[UnresolvedSpec | ResolvedSpec]#
- generate_test_specs(generators: list[AbstractTestGenerator], on_options: list[str]) list[UnresolvedSpec | ResolvedSpec]#
- generate_test_specs_parallel(generators: list[AbstractTestGenerator], on_options: list[str]) list[UnresolvedSpec | ResolvedSpec]#
- worker_init(snapshot: dict[str, Any])#
- generate_test_specs_serial(generators: list[AbstractTestGenerator], on_options: list[str]) list[UnresolvedSpec | ResolvedSpec]#