Description: Do not multiple-inherit NameError and ImportError, rather simply raise NameError when import is not found
Author: Nilesh Patra <nilesh@debian.org>
Last-Update: 2021-12-10
--- a/csb/test/__init__.py
+++ b/csb/test/__init__.py
@@ -443,9 +443,6 @@
                 
         return runner.run(suite)            
 
-class InvalidNamespaceError(NameError, ImportError):
-    pass
-    
 class AbstractTestBuilder(object):
     """
     This is a base class, defining a test loader which exposes the C{loadTests}
@@ -537,7 +534,7 @@
         try:
             base = __import__(namespace, level=0, fromlist=['']).__file__
         except ImportError:
-            raise InvalidNamespaceError('Namespapce {0} is not importable'.format(namespace))
+            raise NameError('Namespace {0} is not importable'.format(namespace))
         
         if os.path.splitext(os.path.basename(base))[0] != '__init__':
             suites.append(self.loadTests(namespace))
@@ -665,7 +662,7 @@
             try:
                 mod = __import__(namespace, fromlist=[''])
             except ImportError:
-                raise InvalidNamespaceError('Namespace {0} is not importable'.format(namespace))
+                raise NameError('Namespace {0} is not importable'.format(namespace))
             suites = self._inspect(mod)                  
             return unittest.TestSuite(suites)    
     
