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

Method test_context

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

Source from the content-addressed store, hash-verified

2441 self.assertIn('inner_raise() # Marker', blocks[2])
2442
2443 def test_context(self):
2444 def inner_raise():
2445 try:
2446 self.zero_div()
2447 except ZeroDivisionError:
2448 raise KeyError
2449 def outer_raise():
2450 inner_raise() # Marker
2451 blocks = boundaries.split(self.get_report(outer_raise))
2452 self.assertEqual(len(blocks), 3)
2453 self.assertEqual(blocks[1], context_message)
2454 self.check_zero_div(blocks[0])
2455 self.assertIn('inner_raise() # Marker', blocks[2])
2456
2457 def test_context_suppression(self):
2458 try:

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