File: py314-asyncio.patch

package info (click to toggle)
python-opentracing 2.4.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 816 kB
  • sloc: python: 3,489; makefile: 98
file content (40 lines) | stat: -rw-r--r-- 1,638 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
From: Colin Watson <cjwatson@debian.org>
Date: Sun, 4 Jan 2026 18:37:19 +0000
Subject: Fix test failures with Python 3.14

`asyncio.get_event_loop` now raises `RuntimeError` if there is no
current event loop.

Bug-Debian: https://bugs.debian.org/1123279
Last-Update: 2026-01-04
---
 tests/scope_managers/test_asyncio.py     | 2 +-
 tests/scope_managers/test_contextvars.py | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/scope_managers/test_asyncio.py b/tests/scope_managers/test_asyncio.py
index 4817f80..868f848 100644
--- a/tests/scope_managers/test_asyncio.py
+++ b/tests/scope_managers/test_asyncio.py
@@ -37,7 +37,7 @@ class AsyncioCompabilityCheck(TestCase, ScopeCompatibilityCheckMixin):
     def run_test(self, test_fn):
         async def async_test_fn():
             test_fn()
-        asyncio.get_event_loop().run_until_complete(async_test_fn())
+        asyncio.new_event_loop().run_until_complete(async_test_fn())
 
     def test_no_event_loop(self):
         # no event loop exists by default in
diff --git a/tests/scope_managers/test_contextvars.py b/tests/scope_managers/test_contextvars.py
index c8c6f61..cfc6eac 100644
--- a/tests/scope_managers/test_contextvars.py
+++ b/tests/scope_managers/test_contextvars.py
@@ -38,7 +38,7 @@ class AsyncioContextVarsCompabilityCheck(
     def run_test(self, test_fn):
         async def async_test_fn():
             test_fn()
-        asyncio.get_event_loop().run_until_complete(async_test_fn())
+        asyncio.new_event_loop().run_until_complete(async_test_fn())
 
     def test_no_event_loop(self):
         # no event loop exists by default in