From: Thomas Grainger Date: Fri, 3 Jan 2025 10:33:35 +0000 (+0000) Subject: gh-128404: Remove `asyncio` from `Lib/test/test_sys_settrace` (#128435) X-Git-Tag: v3.14.0a4~137 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4ed36d6efb3e3bc613045016dee594d671997709;p=thirdparty%2FPython%2Fcpython.git gh-128404: Remove `asyncio` from `Lib/test/test_sys_settrace` (#128435) --- diff --git a/Lib/test/test_sys_settrace.py b/Lib/test/test_sys_settrace.py index e5cf88177f71..28c2c681babe 100644 --- a/Lib/test/test_sys_settrace.py +++ b/Lib/test/test_sys_settrace.py @@ -6,8 +6,7 @@ import sys import difflib import gc from functools import wraps -import asyncio -from test.support import import_helper, requires_subprocess +from test.support import import_helper, requires_subprocess, run_no_yield_async_fn import contextlib import os import tempfile @@ -19,8 +18,6 @@ try: except ImportError: _testinternalcapi = None -support.requires_working_socket(module=True) - class tracecontext: """Context manager that traces its enter and exit.""" def __init__(self, output, value): @@ -2067,10 +2064,9 @@ class JumpTestCase(unittest.TestCase): stack.enter_context(self.assertRaisesRegex(*error)) if warning is not None: stack.enter_context(self.assertWarnsRegex(*warning)) - asyncio.run(func(output)) + run_no_yield_async_fn(func, output) sys.settrace(None) - asyncio._set_event_loop_policy(None) self.compare_jump_output(expected, output) def jump_test(jumpFrom, jumpTo, expected, error=None, event='line', warning=None):