From: Tony Mack Date: Mon, 11 Feb 2008 21:38:17 +0000 (+0000) Subject: catch exceptions when trying to create test instances X-Git-Tag: tests-4.2-4~256 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=ebea881e210d689b91663692ddb1a73902c7d8b2;p=tests.git catch exceptions when trying to create test instances --- diff --git a/qaapi/qa/QAAPI.py b/qaapi/qa/QAAPI.py index 6fe98a6..39ee19e 100644 --- a/qaapi/qa/QAAPI.py +++ b/qaapi/qa/QAAPI.py @@ -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