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

Method test_excepthook

Lib/test/test_sys.py:196–201  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

194 self.assertEndsWith(err, "SyntaxError: msg\n")
195
196 def test_excepthook(self):
197 with test.support.captured_output("stderr") as stderr:
198 with test.support.catch_unraisable_exception():
199 sys.excepthook(1, '1', 1)
200 self.assertTrue("TypeError: print_exception(): Exception expected for " \
201 "value, str found" in stderr.getvalue())
202
203 # FIXME: testing the code for a lost or replaced excepthook in
204 # Python/pythonrun.c::PyErr_PrintEx() is tricky.

Callers

nothing calls this directly

Calls 3

excepthookMethod · 0.80
assertTrueMethod · 0.80
getvalueMethod · 0.45

Tested by

no test coverage detected