diff Lib/test/test_sys.py @ 48840:dfe546b66eef

add NEWS note and test for last commit
author Benjamin Peterson <benjamin@python.org>
date Sat, 23 Aug 2008 20:19:17 +0000
parents cd3b0b7fd8e1
children bb2a0a37faa9
line wrap: on
line diff
--- a/Lib/test/test_sys.py	Sat Aug 23 20:08:07 2008 +0000
+++ b/Lib/test/test_sys.py	Sat Aug 23 20:19:17 2008 +0000
@@ -62,6 +62,12 @@
 
         self.assert_(err.getvalue().endswith("ValueError: 42\n"))
 
+    def test_excepthook(self):
+        with test.support.captured_output("stderr") as stderr:
+            sys.excepthook(1, '1', 1)
+        self.assert_("TypeError: print_exception(): Exception expected for " \
+                         "value, str found" in stderr.getvalue())
+
     # FIXME: testing the code for a lost or replaced excepthook in
     # Python/pythonrun.c::PyErr_PrintEx() is tricky.