cpython: bb67b810aac1 (original) (raw)

Mercurial > cpython

changeset 94735:bb67b810aac1

Issue 23314: SuppressCrashReports now disables CRT assertions SuppressCrashReports should be used in test subprocesses that test invalid conditions.

Steve Dower steve.dower@microsoft.com
date Mon, 23 Feb 2015 07:56:13 -0800
parents 516d3773ecb2
children 3673cc0c1b8f
files Lib/test/support/__init__.py Lib/test/tf_inherit_check.py
diffstat 2 files changed, 44 insertions(+), 15 deletions(-)[+] [-] Lib/test/support/__init__.py 27 Lib/test/tf_inherit_check.py 32

line wrap: on

line diff

--- a/Lib/test/support/init.py +++ b/Lib/test/support/init.py @@ -2151,6 +2151,7 @@ class SuppressCrashReport: disable the creation of coredump file. """ old_value = None

def enter(self): """On Windows, disable Windows Error Reporting dialogs using @@ -2168,6 +2169,26 @@ class SuppressCrashReport: SEM_NOGPFAULTERRORBOX = 0x02 self.old_value = self._k32.SetErrorMode(SEM_NOGPFAULTERRORBOX) self._k32.SetErrorMode(self.old_value | SEM_NOGPFAULTERRORBOX) +

+ else: if resource is not None: try: @@ -2199,6 +2220,12 @@ class SuppressCrashReport: if sys.platform.startswith('win'): self._k32.SetErrorMode(self.old_value) +

--- a/Lib/test/tf_inherit_check.py +++ b/Lib/test/tf_inherit_check.py @@ -4,22 +4,24 @@ import sys import os +from test.support import SuppressCrashReport -verbose = (sys.argv[1] == 'v') -try:

- +with SuppressCrashReport():

+

+

- -except Exception: