MCPcopy Index your code
hub / github.com/python/cpython / test_trace

Method test_trace

Lib/test/test_inspect/test_inspect.py:575–586  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

573 self.assertEqual(record.index, 0)
574
575 def test_trace(self):
576 self.assertEqual(len(git.tr), 3)
577 frame1, frame2, frame3, = git.tr
578 self.assertEqual(revise(*frame1[1:]),
579 (modfile, 43, 'argue', [' spam(a, b, c)\n'], 0))
580 self.assertEqual(frame1.positions, dis.Positions(43, 43, 12, 25))
581 self.assertEqual(revise(*frame2[1:]),
582 (modfile, 9, 'spam', [' eggs(b + d, c + f)\n'], 0))
583 self.assertEqual(frame2.positions, dis.Positions(9, 9, 4, 22))
584 self.assertEqual(revise(*frame3[1:]),
585 (modfile, 18, 'eggs', [' q = y / 0\n'], 0))
586 self.assertEqual(frame3.positions, dis.Positions(18, 18, 8, 13))
587
588 def test_frame(self):
589 args, varargs, varkw, locals = inspect.getargvalues(mod.fr)

Callers

nothing calls this directly

Calls 2

reviseFunction · 0.85
assertEqualMethod · 0.45

Tested by

no test coverage detected