diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2016-03-22 15:13:31 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2016-03-22 15:13:31 (GMT) |
commit | 84aab09421330711607671ed8bc637ea2a8e273c (patch) | |
tree | c8fb3373d3c7dd1cef0764e8da7ccc085926b972 /Lib/test | |
parent | 24f949e10c4031c059118dd4b49cace16d4e3e5d (diff) | |
download | cpython-84aab09421330711607671ed8bc637ea2a8e273c.zip cpython-84aab09421330711607671ed8bc637ea2a8e273c.tar.gz cpython-84aab09421330711607671ed8bc637ea2a8e273c.tar.bz2 |
Issue #26588: add debug traces
Try to debug random failure on buildbots.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_tracemalloc.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_tracemalloc.py b/Lib/test/test_tracemalloc.py index 359d9c0..44cd539 100644 --- a/Lib/test/test_tracemalloc.py +++ b/Lib/test/test_tracemalloc.py @@ -88,6 +88,9 @@ def traceback_filename(filename): class TestTracemallocEnabled(unittest.TestCase): def setUp(self): + if _testcapi: + _testcapi.tracemalloc_set_debug(True) + if tracemalloc.is_tracing(): self.skipTest("tracemalloc must be stopped before the test") @@ -95,6 +98,8 @@ class TestTracemallocEnabled(unittest.TestCase): def tearDown(self): tracemalloc.stop() + if _testcapi: + _testcapi.tracemalloc_set_debug(False) def test_get_tracemalloc_memory(self): data = [allocate_bytes(123) for count in range(1000)] @@ -877,6 +882,9 @@ class TestCAPI(unittest.TestCase): maxDiff = 80 * 20 def setUp(self): + if _testcapi: + _testcapi.tracemalloc_set_debug(True) + if tracemalloc.is_tracing(): self.skipTest("tracemalloc must be stopped before the test") @@ -890,6 +898,8 @@ class TestCAPI(unittest.TestCase): def tearDown(self): tracemalloc.stop() + if _testcapi: + _testcapi.tracemalloc_set_debug(False) def get_traceback(self): frames = _testcapi.tracemalloc_get_traceback(self.domain, self.ptr) |