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

Method test_simple

Lib/test/test_traceback.py:2413–2427  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2411 self.assertStartsWith(lines[-1], 'ZeroDivisionError')
2412
2413 def test_simple(self):
2414 try:
2415 1/0 # Marker
2416 except ZeroDivisionError as _:
2417 e = _
2418 lines = self.get_report(e).splitlines()
2419 if has_no_debug_ranges():
2420 self.assertEqual(len(lines), 4)
2421 self.assertStartsWith(lines[3], 'ZeroDivisionError')
2422 else:
2423 self.assertEqual(len(lines), 5)
2424 self.assertStartsWith(lines[4], 'ZeroDivisionError')
2425 self.assertStartsWith(lines[0], 'Traceback')
2426 self.assertStartsWith(lines[1], ' File')
2427 self.assertIn('1/0 # Marker', lines[2])
2428
2429 def test_cause(self):
2430 def inner_raise():

Callers

nothing calls this directly

Calls 7

has_no_debug_rangesFunction · 0.90
lenFunction · 0.85
assertInMethod · 0.80
splitlinesMethod · 0.45
get_reportMethod · 0.45
assertEqualMethod · 0.45
assertStartsWithMethod · 0.45

Tested by

no test coverage detected