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

Method test_base_exception

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

Source from the content-addressed store, hash-verified

238 self.assertEqual(err[1].strip(), "print(2)")
239
240 def test_base_exception(self):
241 # Test that exceptions derived from BaseException are formatted right
242 e = KeyboardInterrupt()
243 lst = traceback.format_exception_only(e.__class__, e)
244 self.assertEqual(lst, ['KeyboardInterrupt\n'])
245
246 def test_format_exception_only_bad__str__(self):
247 class X(Exception):

Callers

nothing calls this directly

Calls 2

format_exception_onlyMethod · 0.80
assertEqualMethod · 0.45

Tested by

no test coverage detected