()
| 293 | mock_conn.port = 6379 |
| 294 | |
| 295 | async def get_conn(): |
| 296 | # Validate only one client is created in single-client mode when |
| 297 | # concurrent requests are made |
| 298 | nonlocal init_call_count |
| 299 | await asyncio.sleep(0.01) |
| 300 | init_call_count += 1 |
| 301 | return mock_conn |
| 302 | |
| 303 | with mock.patch.object(r.connection_pool, "get_connection", get_conn): |
| 304 | with mock.patch.object(r.connection_pool, "release"): |