[Python-checkins] r46276 - python/branches/sreifschneider-newnewexcept/Lib/test/test_exceptions.py

sean.reifschneider python-checkins at python.org
Fri May 26 11:22:19 CEST 2006


Author: sean.reifschneider
Date: Fri May 26 11:22:19 2006
New Revision: 46276

Modified:
   python/branches/sreifschneider-newnewexcept/Lib/test/test_exceptions.py
Log:
Removing the exception heirarchy test, Brett clue-by-foured me.


Modified: python/branches/sreifschneider-newnewexcept/Lib/test/test_exceptions.py
==============================================================================
--- python/branches/sreifschneider-newnewexcept/Lib/test/test_exceptions.py	(original)
+++ python/branches/sreifschneider-newnewexcept/Lib/test/test_exceptions.py	Fri May 26 11:22:19 2006
@@ -291,70 +291,3 @@
                         ( repr(e), checkArgName,
                             repr(expected[checkArgName]),
                             repr(getattr(e, checkArgName)) ))
-
-
-#  test exception heirarchy
-osErrorChildren = []
-try: osErrorChildren.append(VMSError)
-except: pass
-try: osErrorChildren.append(WindowsError)
-except: pass
-osErrorChildren = tuple(osErrorChildren)
-exceptionHeirarchy = \
-    ( SystemExit,
-    KeyboardInterrupt,
-    Exception,
-       (  GeneratorExit,
-        StopIteration,
-        StandardError,
-            ( ArithmeticError,
-                ( FloatingPointError,
-                OverflowError,
-                ZeroDivisionError, ),
-            AssertionError,
-            AttributeError,
-            EnvironmentError,
-                ( IOError,
-                OSError,
-                    osErrorChildren, ),
-            EOFError,
-            ImportError,
-            LookupError,
-                ( IndexError,
-                KeyError, ),
-            MemoryError,
-            NameError,
-                ( UnboundLocalError, ),
-            ReferenceError,
-            RuntimeError,
-                ( NotImplementedError, ),
-            SyntaxError,
-                ( IndentationError,
-                    ( TabError, ), ),
-            SystemError,
-            TypeError,
-            ValueError,
-                ( UnicodeError,
-                    ( UnicodeDecodeError,
-                    UnicodeEncodeError,
-                    UnicodeTranslateError, ), ), ),
-        Warning,
-            ( DeprecationWarning,
-            PendingDeprecationWarning,
-            RuntimeWarning,
-            SyntaxWarning,
-            UserWarning,
-            FutureWarning,
-            OverflowWarning,
-            ImportWarning, ), ), )
-def checkChildren(parent, children):
-    lastChild = None
-    for child in children:
-        if type(child) == type(tuple()):
-            checkChildren(lastChild, child)
-        else:
-            if not issubclass(child, parent):
-                raise TestFailed('Exception "%s" is not a subclass of "%s"'
-                        % ( repr(child), repr(parent) ))
-        lastChild = child
-checkChildren(BaseException, exceptionHeirarchy)


More information about the Python-checkins mailing list