[Python-checkins] cpython (merge 3.4 -> 3.5): (Merge 3.4) Issue #25274: test_recursionlimit_recovery() of test_sys now checks

victor.stinner python-checkins at python.org
Thu Oct 1 08:57:34 CEST 2015


https://hg.python.org/cpython/rev/898a9a959927
changeset:   98450:898a9a959927
branch:      3.5
parent:      98447:d7d18ef3e05c
parent:      98449:60c4fd84ef92
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Thu Oct 01 08:56:27 2015 +0200
summary:
  (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.

files:
  Lib/test/test_sys.py |  5 +++--
  1 files changed, 3 insertions(+), 2 deletions(-)


diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py
--- a/Lib/test/test_sys.py
+++ b/Lib/test/test_sys.py
@@ -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

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list