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

Method test_print_exc

Lib/test/test_timeit.py:229–236  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

227 self.assertStartsWith(exc_lines[-1], expected_exc_name)
228
229 def test_print_exc(self):
230 s = io.StringIO()
231 t = timeit.Timer("1/0")
232 try:
233 t.timeit()
234 except:
235 t.print_exc(s)
236 self.assert_exc_string(s.getvalue(), 'ZeroDivisionError')
237
238 MAIN_DEFAULT_OUTPUT = "1 loop, best of 5: 1 sec per loop\n"
239

Callers

nothing calls this directly

Calls 4

timeitMethod · 0.95
print_excMethod · 0.95
assert_exc_stringMethod · 0.95
getvalueMethod · 0.95

Tested by

no test coverage detected