From ebea881e210d689b91663692ddb1a73902c7d8b2 Mon Sep 17 00:00:00 2001 From: Tony Mack Date: Mon, 11 Feb 2008 21:38:17 +0000 Subject: [PATCH] catch exceptions when trying to create test instances --- qaapi/qa/QAAPI.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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 -- 2.47.0