(mocker: MockerFixture)
| 124 | |
| 125 | @pytest.fixture |
| 126 | def async_method_mocker(mocker: MockerFixture) -> AsyncMethodMocker: |
| 127 | def _async_method_mocker( |
| 128 | object: Any, |
| 129 | method: str, |
| 130 | return_value: Any = None, |
| 131 | ) -> MagicMock: |
| 132 | mock: MagicMock = mocker.MagicMock() |
| 133 | |
| 134 | future: asyncio.Future = asyncio.Future() |
| 135 | future.set_result(return_value) |
| 136 | mock.return_value = future |
| 137 | mock.side_effect = None |
| 138 | |
| 139 | setattr(object, method, mock) |
| 140 | |
| 141 | return mock |
| 142 | |
| 143 | return _async_method_mocker |
| 144 | |
| 145 | |
| 146 | @pytest.fixture(params=[JWT_SECRET, SecretStr(JWT_SECRET)]) |
no outgoing calls
no test coverage detected
searching dependent graphs…