def test_get_traces(self):
    tracemalloc.clear_traces()
    obj_size = 12345
    (obj, obj_traceback) = allocate_bytes(obj_size)
    traces = tracemalloc._get_traces()
    trace = self.find_trace(traces, obj_traceback)
    self.assertIsInstance(trace, tuple)
    (domain, size, traceback) = trace
    self.assertEqual(size, obj_size)
    self.assertEqual(traceback, obj_traceback._frames)
    tracemalloc.stop()
    self.assertEqual(tracemalloc._get_traces(), [])
def test_get_traces(self):
    tracemalloc.clear_traces()
    obj_size = 12345
    (obj, obj_traceback) = allocate_bytes(obj_size)
    traces = tracemalloc._get_traces()
    trace = self.find_trace(traces, obj_traceback)
    self.assertIsInstance(trace, tuple)
    (domain, size, traceback) = trace
    self.assertEqual(size, obj_size)
    self.assertEqual(traceback, obj_traceback._frames)
    tracemalloc.stop()
    self.assertEqual(tracemalloc._get_traces(), [])