changeset: 98451:bae0912dd160 parent: 98448:1465b18ef4fc parent: 98450:898a9a959927 user: Victor Stinner date: Thu Oct 01 08:56:54 2015 +0200 files: Lib/test/test_sys.py description: (Merge 3.5) 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. diff -r 1465b18ef4fc -r bae0912dd160 Lib/test/test_sys.py --- a/Lib/test/test_sys.py Thu Oct 01 09:49:03 2015 +0300 +++ b/Lib/test/test_sys.py Thu Oct 01 08:56:54 2015 +0200 @@ -197,9 +197,10 @@ 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