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

Method check_zero_div

Lib/test/test_traceback.py:2330–2338  ·  view source on GitHub ↗
(self, msg)

Source from the content-addressed store, hash-verified

2328 1/0 # In zero_div
2329
2330 def check_zero_div(self, msg):
2331 lines = msg.splitlines()
2332 if has_no_debug_ranges():
2333 self.assertStartsWith(lines[-3], ' File')
2334 self.assertIn('1/0 # In zero_div', lines[-2])
2335 else:
2336 self.assertStartsWith(lines[-4], ' File')
2337 self.assertIn('1/0 # In zero_div', lines[-3])
2338 self.assertStartsWith(lines[-1], 'ZeroDivisionError')
2339
2340 def test_simple(self):
2341 try:

Callers 4

test_causeMethod · 0.95
test_contextMethod · 0.95
test_cause_recursiveMethod · 0.95

Calls 4

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

Tested by

no test coverage detected