ContextMock
Mock that mocks :keyword:with statement contexts.
def ContextMock(
*args: any,
**kwargs: any
) - > _ContextMock
Mock that mocks :keyword:with statement contexts.
Parameters
| Name | Type | Description |
|---|---|---|
| *args | any | Positional arguments passed to the underlying _ContextMock constructor. |
| **kwargs | any | Keyword arguments passed to the underlying _ContextMock constructor. |
Returns
| Type | Description |
|---|---|
_ContextMock | A mock object configured to act as a context manager, where enter returns the mock itself and exit returns None to ensure exceptions are not suppressed. |