8000 [3.12] gh-106714: Fix test_capi to not write a coredump (GH-107007) by miss-islington · Pull Request #107009 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

[3.12] gh-106714: Fix test_capi to not write a coredump (GH-107007) #107009

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 1 commit into from
Jul 22, 2023
Merged
Show file tree
Hide file tree
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
12 changes: 9 additions & 3 deletions Lib/test/test_capi/test_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,15 @@ def test_instancemethod(self):

@support.requires_subprocess()
def test_no_FatalError_infinite_loop(self):
run_result, _cmd_line = run_python_until_end(
'-c', 'import _testcapi; _testcapi.crash_no_current_thread()',
)
code = textwrap.dedent("""
import _testcapi
from test import support

with support.SuppressCrashReport():
_testcapi.crash_no_current_thread()
""")

run_result, _cmd_line = run_python_until_end('-c', code)
_rc, out, err = run_result
self.assertEqual(out, b'')
# This used to cause an infinite loop.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
test_capi: Fix test_no_FatalError_infinite_loop() to no longer write a
coredump, by using test.support.SuppressCrashReport. Patch by Victor
Stinner.
0