catch exceptions when trying to create test instances
authorTony Mack <tmack@cs.princeton.edu>
Mon, 11 Feb 2008 21:38:17 +0000 (21:38 +0000)
committerTony Mack <tmack@cs.princeton.edu>
Mon, 11 Feb 2008 21:38:17 +0000 (21:38 +0000)
qaapi/qa/QAAPI.py

index 6fe98a6..39ee19e 100644 (file)
@@ -2,6 +2,7 @@ import sys, os
 import traceback
 import tests
 from Config import Config
+from tests.Test import Test
 from logger import log 
 
 class QAAPI:
@@ -95,12 +96,14 @@ class QAAPI:
        try:
            test = __import__(test_path, globals(), locals(), test_path)
            callables = []
-
            for attribute in dir(test):
                attr = getattr(test, attribute)
                if callable(attr) and hasattr(attr, 'status'):
                    setattr(attr, 'test_name', test_basename+attribute)
-                   callables.append(attr(self.config))
+                   try:
+                       test_instance = attr(self.config)
+                       callables.append(test_instance)
+                   except: pass
            return callables 
        except ImportError, AttributeError:
            raise