projects/aports·blob master · refs

37 lines · 1.4 KiB

1From 603ca4f57ee2f580d59066600e0ca886efcf8700 Mon Sep 17 00:00:00 2001
2From: Karolina Surma <[email protected]>
3Date: Wed, 28 May 2025 10:59:13 +0200
4Subject: [PATCH] asyncio.get_event_loop() doesn't create a new loop since
5 Python 3.14
6
7---
8 aiounittest/case.py | 2 +-
9 tests/test_asynctestcase_get_event_loop.py | 2 +-
10 2 files changed, 2 insertions(+), 2 deletions(-)
11
12diff --git a/aiounittest/case.py b/aiounittest/case.py
13index d4e302b..441eed0 100644
14--- a/aiounittest/case.py
15+++ b/aiounittest/case.py
16@@ -70,7 +70,7 @@ def get_event_loop(self):
17 class MyTest(aiounittest.AsyncTestCase):
18
19 def get_event_loop(self):
20- self.my_loop = asyncio.get_event_loop()
21+ self.my_loop = asyncio.new_event_loop()
22 return self.my_loop
23
24
25diff --git a/tests/test_asynctestcase_get_event_loop.py b/tests/test_asynctestcase_get_event_loop.py
26index 91736ef..5d5de9c 100644
27--- a/tests/test_asynctestcase_get_event_loop.py
28+++ b/tests/test_asynctestcase_get_event_loop.py
29@@ -27,7 +27,7 @@ async def async_nested_exc():
30 class TestAsyncCaseWithCustomLoop(aiounittest.AsyncTestCase):
31
32 def get_event_loop(self):
33- self.my_loop = asyncio.get_event_loop()
34+ self.my_loop = asyncio.new_event_loop()
35 return self.my_loop
36
37 async def test_await_async_add(self):