summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_capi.py
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2013-03-07 16:44:29 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2013-03-07 16:44:29 (GMT)
commit1f38621a336932754b242cd4779e7d0545fd0dfe (patch)
treed3c1332eec7dc52188db3ef644933916a3cd5752 /Lib/test/test_capi.py
parentf9164e13fc10f3ea2e2e36b8eec96566867264f7 (diff)
downloadcpython-1f38621a336932754b242cd4779e7d0545fd0dfe.zip
cpython-1f38621a336932754b242cd4779e7d0545fd0dfe.tar.gz
cpython-1f38621a336932754b242cd4779e7d0545fd0dfe.tar.bz2
#11732: add a new suppress_crash_popup() context manager to test.support that disables crash popups on Windows and use it in test_ctypes.
Diffstat (limited to 'Lib/test/test_capi.py')
-rw-r--r--Lib/test/test_capi.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/Lib/test/test_capi.py b/Lib/test/test_capi.py
index 0ab1458..1c4c0f8 100644
--- a/Lib/test/test_capi.py
+++ b/Lib/test/test_capi.py
@@ -46,11 +46,12 @@ class CAPITest(unittest.TestCase):
@unittest.skipUnless(threading, 'Threading required for this test.')
def test_no_FatalError_infinite_loop(self):
- p = subprocess.Popen([sys.executable, "-c",
- 'import _testcapi;'
- '_testcapi.crash_no_current_thread()'],
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE)
+ with support.suppress_crash_popup():
+ p = subprocess.Popen([sys.executable, "-c",
+ 'import _testcapi;'
+ '_testcapi.crash_no_current_thread()'],
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
(out, err) = p.communicate()
self.assertEqual(out, b'')
# This used to cause an infinite loop.