summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_faulthandler.py
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2013-03-05 18:26:17 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2013-03-05 18:26:17 (GMT)
commit25a404520da6c2560690e457404ea36f4aaa9344 (patch)
tree1148a86f226fa7edf326180cac3e94558ce4481f /Lib/test/test_faulthandler.py
parent884f0585a40d2e3203ee0512aa2f5a39ce660556 (diff)
downloadcpython-25a404520da6c2560690e457404ea36f4aaa9344.zip
cpython-25a404520da6c2560690e457404ea36f4aaa9344.tar.gz
cpython-25a404520da6c2560690e457404ea36f4aaa9344.tar.bz2
#11732: add a new suppress_crash_popup() context manager to test.support.
Diffstat (limited to 'Lib/test/test_faulthandler.py')
-rw-r--r--Lib/test/test_faulthandler.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/test/test_faulthandler.py b/Lib/test/test_faulthandler.py
index b81b34d..4e6d9bc 100644
--- a/Lib/test/test_faulthandler.py
+++ b/Lib/test/test_faulthandler.py
@@ -101,7 +101,8 @@ class FaultHandlerTests(unittest.TestCase):
header=re.escape(header))
if other_regex:
regex += '|' + other_regex
- output, exitcode = self.get_output(code, filename)
+ with support.suppress_crash_popup():
+ output, exitcode = self.get_output(code, filename)
output = '\n'.join(output)
self.assertRegex(output, regex)
self.assertNotEqual(exitcode, 0)
@@ -229,7 +230,8 @@ faulthandler.disable()
faulthandler._read_null()
""".strip()
not_expected = 'Fatal Python error'
- stderr, exitcode = self.get_output(code)
+ with support.suppress_crash_popup():
+ stderr, exitcode = self.get_output(code)
stder = '\n'.join(stderr)
self.assertTrue(not_expected not in stderr,
"%r is present in %r" % (not_expected, stderr))