File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change 1818from .compat import mock
1919
2020
21+ class AwaitableMock (AsyncMock ):
22+ def __await__ (self ):
23+ pass
24+
25+
2126async def _get_info (redis_url ):
2227 client = redis .Redis .from_url (redis_url )
2328 info = await client .info ()
@@ -222,20 +227,15 @@ async def mock_cluster_resp_slaves(create_redis, **kwargs):
222227
223228@pytest_asyncio .fixture ()
224229def mock_connection () -> Connection :
225- mock_connection = AsyncMock (spec = Connection )
226- mock_connection .__await__ = dummy_awaitable
230+ mock_connection = AwaitableMock (spec = Connection )
227231 return mock_connection
228232
229233
230234@pytest_asyncio .fixture ()
231235def mock_pool () -> ConnectionPool :
232- mock_pool = AsyncMock (spec = ConnectionPool )
233- mock_pool .__await__ = dummy_awaitable
236+ mock_pool = AwaitableMock (spec = ConnectionPool )
234237 return mock_pool
235238
236- def dummy_awaitable ():
237- pass
238-
239239
240240@pytest_asyncio .fixture ()
241241async def credential_provider (request ) -> CredentialProvider :
You can’t perform that action at this time.
0 commit comments