diff options
author | Ezio Melotti <ezio.melotti@gmail.com> | 2013-03-20 16:16:05 (GMT) |
---|---|---|
committer | Ezio Melotti <ezio.melotti@gmail.com> | 2013-03-20 16:16:05 (GMT) |
commit | a612176c9c0c82138e797c2abadb6ef65e97b44a (patch) | |
tree | f999fa76c3e5d710be59898f6be3096fa8d51839 | |
parent | c622bf3f8505fbbb33f0e772c4edc5b5e21e9157 (diff) | |
parent | a49178e48e87bd31e09af03fdc8770032e0ab995 (diff) | |
download | cpython-a612176c9c0c82138e797c2abadb6ef65e97b44a.zip cpython-a612176c9c0c82138e797c2abadb6ef65e97b44a.tar.gz cpython-a612176c9c0c82138e797c2abadb6ef65e97b44a.tar.bz2 |
#17493: merge with 3.3.
-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 b664687..4749f24 100644 --- a/Lib/test/test_sys.py +++ b/Lib/test/test_sys.py @@ -239,9 +239,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 @@ -253,14 +250,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 |