Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 87bddba

Browse files
committed
(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.
2 parents 313242a + 3f18f10 commit 87bddba

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

Lib/test/test_sys.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,10 @@ def test_recursionlimit(self):
197197
self.assertEqual(sys.getrecursionlimit(), 10000)
198198
sys.setrecursionlimit(oldlimit)
199199

200-
@unittest.skipIf(hasattr(sys, 'gettrace') and sys.gettrace(),
201-
'fatal error if run with a trace function')
202200
def test_recursionlimit_recovery(self):
201+
if hasattr(sys, 'gettrace') and sys.gettrace():
202+
self.skipTest('fatal error if run with a trace function')
203+
203204
# NOTE: this test is slightly fragile in that it depends on the current
204205
# recursion count when executing the test being low enough so as to
205206
# trigger the recursion recovery detection in the _Py_MakeEndRecCheck

0 commit comments

Comments
 (0)