suite.register¶
register_suite_class() — registers an OttoSuite subclass as a Typer subcommand.
Registration happens at class-definition time (import time), via
OttoSuite.__init_subclass__ calling register_suite_class() for every
Test*-named subclass, storing each suite’s built sub-app into the
module-level SUITES registry. cli/test.py’s suite_app resolves
suite subcommands lazily from that registry through a shared
RegistryBackedGroup (see cli/invoke.py), so no Typer app mutation
happens here or at cli/test.py import time.
No circular imports: this module never imports from otto.cli.test at module
level. The runner function uses a lazy import so the actual test execution can
reach run_suite only when the CLI command is invoked, by which time
cli/test.py is fully loaded.
- class otto.suite.register.SuiteEntry(name: str, sub_app: Typer, file: str)¶
Bases:
objectOne registered suite: its Typer sub-app + source file for attribution.
-
otto.suite.register.SUITES : Registry[SuiteEntry] =
<otto.registry.Registry object>¶ Registered
OttoSuitesubclasses, keyed by class name; populated at import time.
- otto.suite.register.register_suite_class(suite_class: type) None¶
Register an OttoSuite subclass as an
otto testsubcommand.Called automatically by
OttoSuite.__init_subclass__for every subclass whose name matches pytest’s own collection rule (Test*). Builds a Typer sub-app from the class’sOptionsinner class (if present) and registers it intoSUITES;cli/test.py’ssuite_appresolves it lazily by name through itsRegistryBackedGroup.