mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
Issue #10990: Prevent tests from clobbering a set trace function.
Many tests simply didn't care if they unset a pre-existing trace function. This made test coverage impossible. This patch fixes various tests to put back any pre-existing trace function. It also introduces test.support.no_tracing as a decorator which will temporarily unset the trace function for tests which simply fail otherwise. Thanks to Kristian Vlaardingerbroek for helping to find the cause of various trace function unsets.
This commit is contained in:
parent
4709ec0686
commit
31f5929c1e
15 changed files with 283 additions and 221 deletions
|
@ -5,7 +5,7 @@ import pickletools
|
|||
import copyreg
|
||||
from http.cookies import SimpleCookie
|
||||
|
||||
from test.support import TestFailed, TESTFN, run_with_locale
|
||||
from test.support import TestFailed, TESTFN, run_with_locale, no_tracing
|
||||
|
||||
from pickle import bytes_types
|
||||
|
||||
|
@ -1002,6 +1002,7 @@ class AbstractPickleTests(unittest.TestCase):
|
|||
y = self.loads(s)
|
||||
self.assertEqual(y._reduce_called, 1)
|
||||
|
||||
@no_tracing
|
||||
def test_bad_getattr(self):
|
||||
x = BadGetattr()
|
||||
for proto in 0, 1:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue