mirror of
https://github.com/python/cpython.git
synced 2025-07-07 19:35:27 +00:00
gh-128404: Remove asyncio
from Lib/test/test_sys_settrace
(#128435)
This commit is contained in:
parent
830e10651b
commit
4ed36d6efb
1 changed files with 2 additions and 6 deletions
|
@ -6,8 +6,7 @@ import sys
|
||||||
import difflib
|
import difflib
|
||||||
import gc
|
import gc
|
||||||
from functools import wraps
|
from functools import wraps
|
||||||
import asyncio
|
from test.support import import_helper, requires_subprocess, run_no_yield_async_fn
|
||||||
from test.support import import_helper, requires_subprocess
|
|
||||||
import contextlib
|
import contextlib
|
||||||
import os
|
import os
|
||||||
import tempfile
|
import tempfile
|
||||||
|
@ -19,8 +18,6 @@ try:
|
||||||
except ImportError:
|
except ImportError:
|
||||||
_testinternalcapi = None
|
_testinternalcapi = None
|
||||||
|
|
||||||
support.requires_working_socket(module=True)
|
|
||||||
|
|
||||||
class tracecontext:
|
class tracecontext:
|
||||||
"""Context manager that traces its enter and exit."""
|
"""Context manager that traces its enter and exit."""
|
||||||
def __init__(self, output, value):
|
def __init__(self, output, value):
|
||||||
|
@ -2067,10 +2064,9 @@ class JumpTestCase(unittest.TestCase):
|
||||||
stack.enter_context(self.assertRaisesRegex(*error))
|
stack.enter_context(self.assertRaisesRegex(*error))
|
||||||
if warning is not None:
|
if warning is not None:
|
||||||
stack.enter_context(self.assertWarnsRegex(*warning))
|
stack.enter_context(self.assertWarnsRegex(*warning))
|
||||||
asyncio.run(func(output))
|
run_no_yield_async_fn(func, output)
|
||||||
|
|
||||||
sys.settrace(None)
|
sys.settrace(None)
|
||||||
asyncio._set_event_loop_policy(None)
|
|
||||||
self.compare_jump_output(expected, output)
|
self.compare_jump_output(expected, output)
|
||||||
|
|
||||||
def jump_test(jumpFrom, jumpTo, expected, error=None, event='line', warning=None):
|
def jump_test(jumpFrom, jumpTo, expected, error=None, event='line', warning=None):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue