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

Method doTraceback

Lib/test/test_zipimport.py:834–854  ·  view source on GitHub ↗
(self, module)

Source from the content-addressed store, hash-verified

832 self.runDoctest(self.doDoctestSuite)
833
834 def doTraceback(self, module):
835 try:
836 module.do_raise()
837 except Exception as e:
838 tb = e.__traceback__.tb_next
839
840 f,lno,n,line = extract_tb(tb, 1)[0]
841 self.assertEqual(line, raise_src.strip())
842
843 f,lno,n,line = extract_stack(tb.tb_frame, 1)[0]
844 self.assertEqual(line, raise_src.strip())
845
846 s = io.StringIO()
847 print_tb(tb, 1, s)
848 self.assertEndsWith(s.getvalue(),
849 ' def do_raise(): raise TypeError\n'
850 '' if support.has_no_debug_ranges() else
851 ' ^^^^^^^^^^^^^^^\n'
852 )
853 else:
854 raise AssertionError("This ought to be impossible")
855
856 def testTraceback(self):
857 files = {TESTMOD + ".py": raise_src}

Callers

nothing calls this directly

Calls 7

getvalueMethod · 0.95
extract_tbFunction · 0.90
extract_stackFunction · 0.90
print_tbFunction · 0.90
assertEndsWithMethod · 0.80
assertEqualMethod · 0.45
stripMethod · 0.45

Tested by

no test coverage detected