(self)
| 138 | self.assertEqual(traceback, obj_traceback) |
| 139 | |
| 140 | def test_new_reference(self): |
| 141 | tracemalloc.clear_traces() |
| 142 | # gc.collect() indirectly calls PyList_ClearFreeList() |
| 143 | support.gc_collect() |
| 144 | |
| 145 | # Create a list and "destroy it": put it in the PyListObject free list |
| 146 | obj = [] |
| 147 | obj = None |
| 148 | |
| 149 | # Create a list which should reuse the previously created empty list |
| 150 | obj = [] |
| 151 | |
| 152 | nframe = tracemalloc.get_traceback_limit() |
| 153 | frames = get_frames(nframe, -3) |
| 154 | obj_traceback = tracemalloc.Traceback(frames, min(len(frames), nframe)) |
| 155 | |
| 156 | traceback = tracemalloc.get_object_traceback(obj) |
| 157 | self.assertIsNotNone(traceback) |
| 158 | self.assertEqual(traceback, obj_traceback) |
| 159 | |
| 160 | def test_set_traceback_limit(self): |
| 161 | obj_size = 10 |
nothing calls this directly
no test coverage detected