Skip to content

Commit 90c8790

Browse files
committed
gh-128404: remove asyncio from test_sys_settrace
1 parent 8eebe4e commit 90c8790

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

Lib/test/test_sys_settrace.py

Lines changed: 3 additions & 6 deletions
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,10 @@ 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+
2068+
run_no_yield_async_fn(func, output)
20712069

20722070
sys.settrace(None)
2073-
asyncio._set_event_loop_policy(None)
20742071
self.compare_jump_output(expected, output)
20752072

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

0 commit comments

Comments
 (0)