#11732: add a new suppress_crash_popup() context manager to test.support that disables crash popups on Windows and use it in test_ctypes.
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 @@
 
     @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.