Skip to content

gh-128404: remove asyncio from test_sys_settrace #128435

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions Lib/test/test_sys_settrace.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
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
Expand All @@ -19,8 +18,6 @@
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):
Expand Down Expand Up @@ -2067,10 +2064,9 @@ def run_async_test(self, func, jumpFrom, jumpTo, expected, error=None,
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):
Expand Down
Loading