summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2015-10-01 06:56:27 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2015-10-01 06:56:27 (GMT)
commit87bddbac9d178b549fac830adc76bc8f100b2a47 (patch)
tree07e7b123b7dd4ed57d829d060de66ae33a8de7b8 /Lib
parent313242aa03aed2ebdaa0dd47428b60b68d8a4e78 (diff)
parent3f18f10f39a55963e63d544382f0e17668ed97e8 (diff)
downloadcpython-87bddbac9d178b549fac830adc76bc8f100b2a47.zip
cpython-87bddbac9d178b549fac830adc76bc8f100b2a47.tar.gz
cpython-87bddbac9d178b549fac830adc76bc8f100b2a47.tar.bz2
(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.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_sys.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py
index 83549bc..8ec38c8 100644
--- a/Lib/test/test_sys.py
+++ b/Lib/test/test_sys.py
@@ -197,9 +197,10 @@ class SysModuleTest(unittest.TestCase):
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