diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2015-10-01 08:56:54 +0200 |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2015-10-01 08:56:54 +0200 |
commit | 4241bcd4e1bd612b53cde3341ea80bf23efdf74b (patch) | |
tree | d115e80c93562c9cab644c1c7d70a5351f33a7c6 | |
parent | a91b7e0dc7c7000b121f96ccb5ad9e6c6988a47e (diff) | |
parent | 87bddbac9d178b549fac830adc76bc8f100b2a47 (diff) | |
download | cpython-git-4241bcd4e1bd612b53cde3341ea80bf23efdf74b.tar.gz |
(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.
-rw-r--r-- | 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 index ccbf262af8..a6106213c9 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 |