omnipy.util.contexts
| CLASS | DESCRIPTION |
|---|---|
LastErrorHolder |
|
PrintExceptionContext |
|
| FUNCTION | DESCRIPTION |
|---|---|
hold_and_reset_prev_attrib_value |
|
nothing |
|
setup_and_teardown_callback_context |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
print_exception |
|
LastErrorHolder
Bases: AbstractContextManager
| METHOD | DESCRIPTION |
|---|---|
__init__ |
|
raise_derived |
|
Source code in src/omnipy/util/contexts.py
__init__
PrintExceptionContext
hold_and_reset_prev_attrib_value
hold_and_reset_prev_attrib_value(
obj: object, attr_name: str, copy_attr: bool = False
) -> Iterator[None]
Source code in src/omnipy/util/contexts.py
nothing
setup_and_teardown_callback_context
setup_and_teardown_callback_context(
*,
setup_func: Callable[..., _ValT] | None = None,
setup_func_args: tuple[object, ...] = (),
setup_func_kwargs: dict[str, object] = {},
exception_func: Callable[..., None] | None = None,
exception_func_args: tuple[object, ...] = (),
exception_func_kwargs: dict[str, object] = {},
teardown_func: Callable[..., None] | None = None,
teardown_func_args: tuple[object, ...] = (),
teardown_func_kwargs: dict[str, object] = {},
) -> Iterator[_ValT | None]