diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2017-04-21 15:59:23 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-21 15:59:23 (GMT) |
commit | 2a1aed04b0943636f605543522e16cca1dc23e70 (patch) | |
tree | 0d64e235a35655978d47ba84a4fbcc2c8609b73d /Lib/test/test_io.py | |
parent | a2c877c3985aba4adb19755e21f477e1c639cfd9 (diff) | |
download | cpython-2a1aed04b0943636f605543522e16cca1dc23e70.zip cpython-2a1aed04b0943636f605543522e16cca1dc23e70.tar.gz cpython-2a1aed04b0943636f605543522e16cca1dc23e70.tar.bz2 |
bpo-30107: don't dump core on expected test_io crash (#1235)
test_io has two unit tests which trigger a deadlock:
* test_daemon_threads_shutdown_stdout_deadlock()
* test_daemon_threads_shutdown_stderr_deadlock()
These tests call Py_FatalError() if the expected bug is triggered
which calls abort(). Use test.support.SuppressCrashReport to prevent
the creation on a core dump, to fix the warning:
Warning -- files was modified by test_io
Before: []
After: ['python.core']
Diffstat (limited to 'Lib/test/test_io.py')
-rw-r--r-- | Lib/test/test_io.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py index 46c7833..69487a1 100644 --- a/Lib/test/test_io.py +++ b/Lib/test/test_io.py @@ -3732,6 +3732,7 @@ class CMiscIOTest(MiscIOTest): import sys import time import threading + from test.support import SuppressCrashReport file = sys.{stream_name} @@ -3740,6 +3741,10 @@ class CMiscIOTest(MiscIOTest): file.write('.') file.flush() + crash = SuppressCrashReport() + crash.__enter__() + # don't call __exit__(): the crash occurs at Python shutdown + thread = threading.Thread(target=run) thread.daemon = True thread.start() |