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

Method test_base_exception

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

Source from the content-addressed store, hash-verified

215 self.assertEqual(err[1].strip(), "print(2)")
216
217 def test_base_exception(self):
218 # Test that exceptions derived from BaseException are formatted right
219 e = KeyboardInterrupt()
220 lst = traceback.format_exception_only(e.__class__, e)
221 self.assertEqual(lst, ['KeyboardInterrupt\n'])
222
223 def test_format_exception_only_bad__str__(self):
224 class X(Exception):

Callers

nothing calls this directly

Calls 2

format_exception_onlyMethod · 0.80
assertEqualMethod · 0.45

Tested by

no test coverage detected