summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_sys.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2008-08-23 20:19:17 (GMT)
committerBenjamin Peterson <benjamin@python.org>2008-08-23 20:19:17 (GMT)
commitbc74e5be1a7c1647e87218c8548fa50163cbf781 (patch)
tree28dd92668bae5b9ef7425377061b1c47ac676927 /Lib/test/test_sys.py
parent2658260f3b4984b03e60cc5856e1203e0cd1f807 (diff)
downloadcpython-bc74e5be1a7c1647e87218c8548fa50163cbf781.zip
cpython-bc74e5be1a7c1647e87218c8548fa50163cbf781.tar.gz
cpython-bc74e5be1a7c1647e87218c8548fa50163cbf781.tar.bz2
add NEWS note and test for last commit
Diffstat (limited to 'Lib/test/test_sys.py')
-rw-r--r--Lib/test/test_sys.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py
index 04288d9..2b9a5d5 100644
--- a/Lib/test/test_sys.py
+++ b/Lib/test/test_sys.py
@@ -62,6 +62,12 @@ class SysModuleTest(unittest.TestCase):
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.