setup_default_app
Setup default app for testing.
Ensures state is clean after the test returns.
def setup_default_app(
app: Application,
use_trap: boolean = False
) - > contextmanager
Setup default app for testing. Ensures state is clean after the test returns.
Parameters
| Name | Type | Description |
|---|---|---|
| app | Application | The application instance to be configured as the default for the duration of the context. |
| use_trap | boolean = False | If true, wraps the execution within a trap context to capture or isolate application behavior. |
Returns
| Type | Description |
|---|---|
contextmanager | A context manager that restores the global application state, closes the temporary app, and cleans up finalizers upon exit. |