Skip to content

Commit 4ed36d6

Browse files
authored
gh-128404: Remove asyncio from Lib/test/test_sys_settrace (#128435)
1 parent 830e106 commit 4ed36d6

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

Lib/test/test_sys_settrace.py

+2-6
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
import difflib
77
import gc
88
from functools import wraps
9-
import asyncio
10-
from test.support import import_helper, requires_subprocess
9+
from test.support import import_helper, requires_subprocess, run_no_yield_async_fn
1110
import contextlib
1211
import os
1312
import tempfile
@@ -19,8 +18,6 @@
1918
except ImportError:
2019
_testinternalcapi = None
2120

22-
support.requires_working_socket(module=True)
23-
2421
class tracecontext:
2522
"""Context manager that traces its enter and exit."""
2623
def __init__(self, output, value):
@@ -2067,10 +2064,9 @@ def run_async_test(self, func, jumpFrom, jumpTo, expected, error=None,
20672064
stack.enter_context(self.assertRaisesRegex(*error))
20682065
if warning is not None:
20692066
stack.enter_context(self.assertWarnsRegex(*warning))
2070-
asyncio.run(func(output))
2067+
run_no_yield_async_fn(func, output)
20712068

20722069
sys.settrace(None)
2073-
asyncio._set_event_loop_policy(None)
20742070
self.compare_jump_output(expected, output)
20752071

20762072
def jump_test(jumpFrom, jumpTo, expected, error=None, event='line', warning=None):

0 commit comments

Comments
 (0)