(self)
| 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): |
nothing calls this directly
no test coverage detected