]> granicus.if.org Git - python/commitdiff
#17493: re-enable a test on Windows. Patch by Zachary Ware.
authorEzio Melotti <ezio.melotti@gmail.com>
Wed, 20 Mar 2013 16:14:48 +0000 (18:14 +0200)
committerEzio Melotti <ezio.melotti@gmail.com>
Wed, 20 Mar 2013 16:14:48 +0000 (18:14 +0200)
Lib/test/test_sys.py

index a52767a11061a1064805c704e7cdb45e272c53c5..890110a26c7cdf63180d838ee7f548749cd2cc23 100644 (file)
@@ -237,9 +237,6 @@ class SysModuleTest(unittest.TestCase):
     def test_recursionlimit_fatalerror(self):
         # A fatal error occurs if a second recursion limit is hit when recovering
         # from a first one.
-        if os.name == "nt":
-            raise unittest.SkipTest(
-                "under Windows, test would generate a spurious crash dialog")
         code = textwrap.dedent("""
             import sys
 
@@ -251,14 +248,15 @@ class SysModuleTest(unittest.TestCase):
 
             sys.setrecursionlimit(%d)
             f()""")
-        for i in (50, 1000):
-            sub = subprocess.Popen([sys.executable, '-c', code % i],
-                stderr=subprocess.PIPE)
-            err = sub.communicate()[1]
-            self.assertTrue(sub.returncode, sub.returncode)
-            self.assertTrue(
-                b"Fatal Python error: Cannot recover from stack overflow" in err,
-                err)
+        with test.support.suppress_crash_popup():
+            for i in (50, 1000):
+                sub = subprocess.Popen([sys.executable, '-c', code % i],
+                    stderr=subprocess.PIPE)
+                err = sub.communicate()[1]
+                self.assertTrue(sub.returncode, sub.returncode)
+                self.assertIn(
+                    b"Fatal Python error: Cannot recover from stack overflow",
+                    err)
 
     def test_getwindowsversion(self):
         # Raise SkipTest if sys doesn't have getwindowsversion attribute