8000 GH-94438: Fix `RuntimeWarning` for jump tests in `test_sys_settrace` by gaogaotiantian · Pull Request #111341 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

GH-94438: Fix RuntimeWarning for jump tests in test_sys_settrace #111341

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 4 commits into from
Oct 26, 2023
Merged
Changes from 1 commit
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 8000
Diff view
Diff view
Prev Previous commit
Next Next commit
Add warning check
  • Loading branch information
gaogaotiantian committed Oct 26, 2023
commit 16a158a372f011f2c30ce89b53670250bbf7c21e
4 changes: 4 additions & 0 deletions Lib/test/test_sys_settrace.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import asyncio
from test.support import import_helper
import contextlib
import warnings

support.requires_working_socket(module=True)

Expand Down Expand Up @@ -2001,6 +2002,9 @@ def run_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))
else:
stack.enter_context(warnings.catch_warnings())
warnings.filterwarnings('error')
func(output)

sys.settrace(None)
Expand Down
0