From: Jeremy Hylton Date: Tue, 20 Jun 2000 18:52:57 +0000 (+0000) Subject: add minimal test of exception use. verify that each exception can be X-Git-Tag: v2.0b1~1462 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=56c807d318954222bb67167477d98eafb6b85d81;p=thirdparty%2FPython%2Fcpython.git add minimal test of exception use. verify that each exception can be raised, caught, and converted to a string. --- diff --git a/Lib/test/test_exceptions.py b/Lib/test/test_exceptions.py index d172ecd153b0..7bc515c48861 100644 --- a/Lib/test/test_exceptions.py +++ b/Lib/test/test_exceptions.py @@ -6,7 +6,19 @@ from types import ClassType print '5. Built-in exceptions' # XXX This is not really enough, each *operation* should be tested! +def test_raise_catch(exc): + try: + raise exc, "spam" + except exc, err: + buf = str(err) + try: + raise exc("spam") + except exc, err: + buf = str(err) + print buf + def r(thing): + test_raise_catch(thing) if type(thing) == ClassType: print thing.__name__ else: