diff options
author | Ezio Melotti <ezio.melotti@gmail.com> | 2013-03-20 16:14:48 (GMT) |
---|---|---|
committer | Ezio Melotti <ezio.melotti@gmail.com> | 2013-03-20 16:14:48 (GMT) |
commit | 958f7ae8651bb6347a0401fe9db7d0a219daf156 (patch) | |
tree | 3bd4eb5612fbace19043cdece48b1e1cc3f8877a /Lib/test | |
parent | 93115e0914306ed1f5bdfc28b6449d863ff0b655 (diff) | |
download | cpython-958f7ae8651bb6347a0401fe9db7d0a219daf156.zip cpython-958f7ae8651bb6347a0401fe9db7d0a219daf156.tar.gz cpython-958f7ae8651bb6347a0401fe9db7d0a219daf156.tar.bz2 |
#17493: re-enable a test on Windows. Patch by Zachary Ware.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_sys.py | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py index a52767a..890110a 100644 --- a/Lib/test/test_sys.py +++ b/Lib/test/test_sys.py @@ -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 |