def test_print_report_max_depth(self):
hook = memory_hooks.LineProfileHook(max_depth=1)
with hook:
p = self.pool.malloc(1000)
del p
io = six.StringIO()
hook.print_report(file=io)
actual = io.getvalue()
self.assertEqual(2, len(actual.split('\n')))
hook = memory_hooks.LineProfileHook(max_depth=2)
with hook:
p = self.pool.malloc(1000)
del p
io = six.StringIO()
hook.print_report(file=io)
actual = io.getvalue()
self.assertEqual(3, len(actual.split('\n')))
评论列表
文章目录