From 61329e19d9493f4c96420d72464ae07b0d52db26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Ga=C5=82uszka?= Date: Tue, 14 Jan 2025 17:58:00 +0100 Subject: [PATCH] fix: have a seperate loop for every test --- tests/helpers.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/helpers.py b/tests/helpers.py index 7ee76a13..d831203c 100644 --- a/tests/helpers.py +++ b/tests/helpers.py @@ -3,12 +3,11 @@ def async_test(coro): - loop = asyncio.new_event_loop() - asyncio.set_event_loop(loop) - def wrapper(*args, **kwargs): + loop = asyncio.new_event_loop() + asyncio.set_event_loop(loop) future = coro(*args, **kwargs) - return asyncio.get_event_loop().run_until_complete(future) + return loop.run_until_complete(future) return wrapper