aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Chris Lovering <[email protected]>2022-07-23 22:44:58 +0100
committerGravatar Chris Lovering <[email protected]>2022-08-14 19:43:51 +0100
commitf599c7bb945a4d0e26ff3e9f5f234f3f34f5ff16 (patch)
tree9d1ae2b89fae9c8dbaf172b89a118ee9c3be2900
parentBump to Python 3.10 (diff)
Remove call to get_event_loop in tests
get_event_loop is deprecated as of 3.10 if there is no running loop.
-rw-r--r--tests/bot/exts/moderation/test_silence.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/tests/bot/exts/moderation/test_silence.py b/tests/bot/exts/moderation/test_silence.py
index 65aecad28..82ec138db 100644
--- a/tests/bot/exts/moderation/test_silence.py
+++ b/tests/bot/exts/moderation/test_silence.py
@@ -16,20 +16,19 @@ from tests.helpers import (
)
redis_session = None
-redis_loop = asyncio.get_event_loop()
def setUpModule(): # noqa: N802
"""Create and connect to the fakeredis session."""
global redis_session
redis_session = RedisSession(use_fakeredis=True)
- redis_loop.run_until_complete(redis_session.connect())
+ asyncio.run(redis_session.connect())
def tearDownModule(): # noqa: N802
"""Close the fakeredis session."""
if redis_session:
- redis_loop.run_until_complete(redis_session.close())
+ asyncio.run(redis_session.client.close())
# Have to subclass it because builtins can't be patched.