diff options
author | Ezio Melotti <ezio.melotti@gmail.com> | 2013-03-20 16:15:37 (GMT) |
---|---|---|
committer | Ezio Melotti <ezio.melotti@gmail.com> | 2013-03-20 16:15:37 (GMT) |
commit | a49178e48e87bd31e09af03fdc8770032e0ab995 (patch) | |
tree | 61687cce88594862ca186166dcb1fc1ffb7f1690 | |
parent | ba7dd670cb5e4aa9c00c0e5347c53a46b3ec110a (diff) | |
parent | 958f7ae8651bb6347a0401fe9db7d0a219daf156 (diff) | |
download | cpython-a49178e48e87bd31e09af03fdc8770032e0ab995.zip cpython-a49178e48e87bd31e09af03fdc8770032e0ab995.tar.gz cpython-a49178e48e87bd31e09af03fdc8770032e0ab995.tar.bz2 |
#17493: merge with 3.2.
-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 e5ec85c..77d333d 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 |