summaryrefslogtreecommitdiff
path: root/tests/test_asyncio/test_connection_pool.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_asyncio/test_connection_pool.py')
-rw-r--r--tests/test_asyncio/test_connection_pool.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/test_asyncio/test_connection_pool.py b/tests/test_asyncio/test_connection_pool.py
index 5de25f2..d1e52bd 100644
--- a/tests/test_asyncio/test_connection_pool.py
+++ b/tests/test_asyncio/test_connection_pool.py
@@ -243,11 +243,11 @@ class TestBlockingConnectionPool:
) as pool:
c1 = await pool.get_connection("_")
- start = asyncio.get_event_loop().time()
+ start = asyncio.get_running_loop().time()
with pytest.raises(redis.ConnectionError):
await pool.get_connection("_")
# we should have waited at least 0.1 seconds
- assert asyncio.get_event_loop().time() - start >= 0.1
+ assert asyncio.get_running_loop().time() - start >= 0.1
await c1.disconnect()
async def test_connection_pool_blocks_until_conn_available(self, master_host):
@@ -265,9 +265,9 @@ class TestBlockingConnectionPool:
await asyncio.sleep(0.1)
await pool.release(c1)
- start = asyncio.get_event_loop().time()
+ start = asyncio.get_running_loop().time()
await asyncio.gather(target(), pool.get_connection("_"))
- assert asyncio.get_event_loop().time() - start >= 0.1
+ assert asyncio.get_running_loop().time() - start >= 0.1
async def test_reuse_previously_released_connection(self, master_host):
connection_kwargs = {"host": master_host}
@@ -668,12 +668,12 @@ class TestHealthCheck:
await redis.flushall()
def assert_interval_advanced(self, connection):
- diff = connection.next_health_check - asyncio.get_event_loop().time()
+ diff = connection.next_health_check - asyncio.get_running_loop().time()
assert self.interval >= diff > (self.interval - 1)
async def test_health_check_runs(self, r):
if r.connection:
- r.connection.next_health_check = asyncio.get_event_loop().time() - 1
+ r.connection.next_health_check = asyncio.get_running_loop().time() - 1
await r.connection.check_health()
self.assert_interval_advanced(r.connection)
@@ -681,7 +681,7 @@ class TestHealthCheck:
# invoke a command to make sure the connection is entirely setup
if r.connection:
await r.get("foo")
- r.connection.next_health_check = asyncio.get_event_loop().time()
+ r.connection.next_health_check = asyncio.get_running_loop().time()
with mock.patch.object(
r.connection, "send_command", wraps=r.connection.send_command
) as m: