From: Barry Warsaw Date: Fri, 22 Aug 1997 21:28:05 +0000 (+0000) Subject: Added a few more tests of exception class raising X-Git-Tag: v1.5a4~322 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=558f66ff53e913070ca518559420148d5a9a034b;p=thirdparty%2FPython%2Fcpython.git Added a few more tests of exception class raising --- diff --git a/Lib/test/test_opcodes.py b/Lib/test/test_opcodes.py index 656e00af2439..107b697dd5c4 100644 --- a/Lib/test/test_opcodes.py +++ b/Lib/test/test_opcodes.py @@ -28,6 +28,9 @@ print '2.2 raise class exceptions' class AClass: pass class BClass(AClass): pass class CClass: pass +class DClass(AClass): + def __init__(self, ignore): + pass try: raise AClass() except: pass @@ -55,9 +58,14 @@ try: raise b except AClass, v: if v != b: raise TestFailed +# not enough arguments try: raise BClass, a except TypeError: pass +try: raise DClass, a +except DClass, v: + if not isinstance(v, DClass): + raise TestFailed print '2.3 comparing function objects'