Return mock for __init__() method on `cls`. The patch is reversed after pytest uses it.
(request: FixtureRequest, cls: type, autospec: bool = True, **kwargs: Any)
| 60 | |
| 61 | |
| 62 | def initializer_mock(request: FixtureRequest, cls: type, autospec: bool = True, **kwargs: Any): |
| 63 | """Return mock for __init__() method on `cls`. |
| 64 | |
| 65 | The patch is reversed after pytest uses it. |
| 66 | """ |
| 67 | _patch = patch.object(cls, "__init__", autospec=autospec, return_value=None, **kwargs) |
| 68 | request.addfinalizer(_patch.stop) |
| 69 | return _patch.start() |
| 70 | |
| 71 | |
| 72 | def instance_mock( |
no outgoing calls
searching dependent graphs…