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 heavy imports at module load: the runner reaches the suite-run engine
(otto.suite.run.run_suite()) through a lazy import so the pytest-touching
core is pulled only when a suite command actually runs, not at registration
(import) time.
- class otto.suite.register.SuiteEntry(name: str, sub_app: Typer, file: str, cls: type)¶
Bases:
objectOne registered suite: its Typer sub-app + source file + suite class.
-
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.