diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2017-06-27 13:37:19 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-27 13:37:19 (GMT) |
commit | 2d775589d98959abb9833121bd9d417003de56c0 (patch) | |
tree | 0f3d4a2bcb266e060905efa9044b06a2fb9cdcf8 /Lib/test/test_subprocess.py | |
parent | 95a91df0363f88722ea2860d9d42a0b04b3f8be2 (diff) | |
download | cpython-2d775589d98959abb9833121bd9d417003de56c0.zip cpython-2d775589d98959abb9833121bd9d417003de56c0.tar.gz cpython-2d775589d98959abb9833121bd9d417003de56c0.tar.bz2 |
bpo-30705: Fix test_regrtest.test_crashed() (#2439)
* Add test.support._crash_python() which triggers a crash but uses
test.support.SuppressCrashReport() to prevent a crash report from
popping up.
* Modify test_child_terminated_in_stopped_state() of test_subprocess
and test_crashed() of test_regrtest to use _crash_python().
Diffstat (limited to 'Lib/test/test_subprocess.py')
-rw-r--r-- | Lib/test/test_subprocess.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py index e0eb6f2..7763337 100644 --- a/Lib/test/test_subprocess.py +++ b/Lib/test/test_subprocess.py @@ -1277,7 +1277,7 @@ class POSIXProcessTestCase(BaseTestCase): code = textwrap.dedent(""" import ctypes - from test.support import SuppressCrashReport + from test.support import _crash_python libc = ctypes.CDLL({libc_name!r}) libc.ptrace({PTRACE_TRACEME}, 0, 0) @@ -1288,9 +1288,8 @@ class POSIXProcessTestCase(BaseTestCase): raise unittest.SkipTest('ptrace() failed - unable to test') code += textwrap.dedent(""" - with SuppressCrashReport(): - # Crash the process - libc.printf(ctypes.c_char_p(0xdeadbeef)) # Crash the process. + # Crash the process + _crash_python() """) child = subprocess.Popen([sys.executable, '-c', code]) try: |