Skip to content

Commit

Permalink
(Merge 3.4) Issue python#25274: test_recursionlimit_recovery() of tes…
Browse files Browse the repository at this point in the history
…t_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.
  • Loading branch information
vstinner committed Oct 1, 2015
2 parents 313242a + 3f18f10 commit 87bddba
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Lib/test/test_sys.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,10 @@ def test_recursionlimit(self):
self.assertEqual(sys.getrecursionlimit(), 10000)
sys.setrecursionlimit(oldlimit)

@unittest.skipIf(hasattr(sys, 'gettrace') and sys.gettrace(),
'fatal error if run with a trace function')
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
# recursion count when executing the test being low enough so as to
# trigger the recursion recovery detection in the _Py_MakeEndRecCheck
Expand Down

0 comments on commit 87bddba

Please sign in to comment.