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: object

One registered suite: its Typer sub-app + source file for attribution.

name : str
sub_app : Typer
file : str
otto.suite.register.SUITES : Registry[SuiteEntry] = <otto.registry.Registry object>

Registered OttoSuite subclasses, 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 test subcommand.

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’s Options inner class (if present) and registers it into SUITES; cli/test.py’s suite_app resolves it lazily by name through its RegistryBackedGroup.