Skip to content

Commit 3d525d0

Browse files
committed
tests: Don't use deprecated asyncio method
It was removed in python3.14 Signed-off-by: Manuel Traut <manut@mecka.net>
1 parent db8de4d commit 3d525d0

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

tests/__init__.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,10 @@ def tearDown(self) -> None:
1010
inject.clear()
1111

1212
def run_async(self, awaitable: t.Awaitable): # noqa: ANN201
13-
loop = asyncio.get_event_loop()
14-
return loop.run_until_complete(awaitable)
13+
loop = asyncio.new_event_loop()
14+
asyncio.set_event_loop(loop)
15+
try:
16+
ret = loop.run_until_complete(awaitable)
17+
finally:
18+
loop.close()
19+
return ret

0 commit comments

Comments
 (0)