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

Method test_print_exc

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

Source from the content-addressed store, hash-verified

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

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