Return mock for method `method_name` on `cls`. The patch is reversed after pytest uses it.
(
request: FixtureRequest, cls: type, method_name: str, autospec: bool = True, **kwargs: Any
)
| 97 | |
| 98 | |
| 99 | def method_mock( |
| 100 | request: FixtureRequest, cls: type, method_name: str, autospec: bool = True, **kwargs: Any |
| 101 | ): |
| 102 | """Return mock for method `method_name` on `cls`. |
| 103 | |
| 104 | The patch is reversed after pytest uses it. |
| 105 | """ |
| 106 | _patch = patch.object(cls, method_name, autospec=autospec, **kwargs) |
| 107 | request.addfinalizer(_patch.stop) |
| 108 | return _patch.start() |
| 109 | |
| 110 | |
| 111 | def open_mock(request: FixtureRequest, module_name: str, **kwargs: Any): |
no outgoing calls
searching dependent graphs…