from oeqa.core.decorator import decoratorClasses, OETestDecorator, \
OETestFilter, OETestDiscover
-def _make_failed_test(classname, methodname, exception, suiteClass):
- """
- When loading tests, the unittest framework stores any exceptions and
- displays them only when the 'run' method is called.
-
- For our purposes, it is better to raise the exceptions in the loading
- step rather than waiting to run the test suite.
- """
- raise exception
+if sys.version_info >= (3,4,4):
+ def _make_failed_test(classname, methodname, exception, suiteClass):
+ """
+ When loading tests, the unittest framework stores any exceptions and
+ displays them only when the 'run' method is called.
+
+ For our purposes, it is better to raise the exceptions in the loading
+ step rather than waiting to run the test suite.
+ """
+ raise exception
+else:
+ def _make_failed_test(classname, exception, suiteClass):
+ raise exception
unittest.loader._make_failed_test = _make_failed_test
def _find_duplicated_modules(suite, directory):