diff options
Diffstat (limited to 'Lib/test/test_traceback.py')
-rw-r--r-- | Lib/test/test_traceback.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_traceback.py b/Lib/test/test_traceback.py index 22c04567a72..1b59f987aa2 100644 --- a/Lib/test/test_traceback.py +++ b/Lib/test/test_traceback.py @@ -103,6 +103,12 @@ def test(): import sys sys.exc_traceback.__members__ + def test_base_exception(self): + # Test that exceptions derived from BaseException are formatted right + e = KeyboardInterrupt() + lst = traceback.format_exception_only(e.__class__, e) + self.assertEqual(lst, ['KeyboardInterrupt\n']) + def test_main(): run_unittest(TracebackCases) |