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

Method test_cause

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

Source from the content-addressed store, hash-verified

2427 self.assertIn('1/0 # Marker', lines[2])
2428
2429 def test_cause(self):
2430 def inner_raise():
2431 try:
2432 self.zero_div()
2433 except ZeroDivisionError as e:
2434 raise KeyError from e
2435 def outer_raise():
2436 inner_raise() # Marker
2437 blocks = boundaries.split(self.get_report(outer_raise))
2438 self.assertEqual(len(blocks), 3)
2439 self.assertEqual(blocks[1], cause_message)
2440 self.check_zero_div(blocks[0])
2441 self.assertIn('inner_raise() # Marker', blocks[2])
2442
2443 def test_context(self):
2444 def inner_raise():

Callers

nothing calls this directly

Calls 6

check_zero_divMethod · 0.95
lenFunction · 0.85
assertInMethod · 0.80
splitMethod · 0.45
get_reportMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected