MCPcopy Index your code
hub / github.com/RustPython/RustPython / doTraceback

Method doTraceback

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

Source from the content-addressed store, hash-verified

822 self.runDoctest(self.doDoctestSuite)
823
824 def doTraceback(self, module):
825 try:
826 module.do_raise()
827 except Exception as e:
828 tb = e.__traceback__.tb_next
829
830 f,lno,n,line = extract_tb(tb, 1)[0]
831 self.assertEqual(line, raise_src.strip())
832
833 f,lno,n,line = extract_stack(tb.tb_frame, 1)[0]
834 self.assertEqual(line, raise_src.strip())
835
836 s = io.StringIO()
837 print_tb(tb, 1, s)
838 self.assertEndsWith(s.getvalue(),
839 ' def do_raise(): raise TypeError\n'
840 '' if support.has_no_debug_ranges() else
841 ' ^^^^^^^^^^^^^^^\n'
842 )
843 else:
844 raise AssertionError("This ought to be impossible")
845
846 @unittest.expectedFailure # TODO: RUSTPYTHON; empty caret lines from equal col/end_col
847 def testTraceback(self):

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected