mirror of https://github.com/python/cpython
(Merge 3.4) Issue #25274: test_recursionlimit_recovery() of test_sys now checks
sys.gettrace() when the test is executed, not when the module is loaded. sys.settrace() may be after after the test is loaded.
This commit is contained in:
commit
87bddbac9d
|
@ -197,9 +197,10 @@ class SysModuleTest(unittest.TestCase):
|
||||||
self.assertEqual(sys.getrecursionlimit(), 10000)
|
self.assertEqual(sys.getrecursionlimit(), 10000)
|
||||||
sys.setrecursionlimit(oldlimit)
|
sys.setrecursionlimit(oldlimit)
|
||||||
|
|
||||||
@unittest.skipIf(hasattr(sys, 'gettrace') and sys.gettrace(),
|
|
||||||
'fatal error if run with a trace function')
|
|
||||||
def test_recursionlimit_recovery(self):
|
def test_recursionlimit_recovery(self):
|
||||||
|
if hasattr(sys, 'gettrace') and sys.gettrace():
|
||||||
|
self.skipTest('fatal error if run with a trace function')
|
||||||
|
|
||||||
# NOTE: this test is slightly fragile in that it depends on the current
|
# NOTE: this test is slightly fragile in that it depends on the current
|
||||||
# recursion count when executing the test being low enough so as to
|
# recursion count when executing the test being low enough so as to
|
||||||
# trigger the recursion recovery detection in the _Py_MakeEndRecCheck
|
# trigger the recursion recovery detection in the _Py_MakeEndRecCheck
|
||||||
|
|
Loading…
Reference in New Issue