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

Method test_simple

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

Source from the content-addressed store, hash-verified

2338 self.assertStartsWith(lines[-1], 'ZeroDivisionError')
2339
2340 def test_simple(self):
2341 try:
2342 1/0 # Marker
2343 except ZeroDivisionError as _:
2344 e = _
2345 lines = self.get_report(e).splitlines()
2346 if has_no_debug_ranges():
2347 self.assertEqual(len(lines), 4)
2348 self.assertStartsWith(lines[3], 'ZeroDivisionError')
2349 else:
2350 self.assertEqual(len(lines), 5)
2351 self.assertStartsWith(lines[4], 'ZeroDivisionError')
2352 self.assertStartsWith(lines[0], 'Traceback')
2353 self.assertStartsWith(lines[1], ' File')
2354 self.assertIn('1/0 # Marker', lines[2])
2355
2356 def test_cause(self):
2357 def inner_raise():

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected