summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/core
diff options
context:
space:
mode:
authorAníbal Limón <anibal.limon@linux.intel.com>2017-06-15 17:09:49 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-06-23 11:44:12 +0100
commitd8380d098a290510b442a7abd2dd5a50cabf5844 (patch)
tree02d90d84bfe3460851a7c50596b5c9997ec83441 /meta/lib/oeqa/core
parentaa6e333de945e1728739718e12a3e2ffdd5fbace (diff)
downloadpoky-d8380d098a290510b442a7abd2dd5a50cabf5844.tar.gz
oeqa/core/loader.py: Fix _make_failed_test for python >= 3.4.4
Python unittest change the signature of the _make_failed_test after python 3.4.4 don't pass the method name. (From OE-Core rev: 767b68e6ca22512ff80e6fbc42154f3f0c2206c0) Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/core')
-rw-r--r--meta/lib/oeqa/core/loader.py22
1 files changed, 13 insertions, 9 deletions
diff --git a/meta/lib/oeqa/core/loader.py b/meta/lib/oeqa/core/loader.py
index 229f094b38..80e3d2800c 100644
--- a/meta/lib/oeqa/core/loader.py
+++ b/meta/lib/oeqa/core/loader.py
@@ -12,15 +12,19 @@ from oeqa.core.case import OETestCase
12from oeqa.core.decorator import decoratorClasses, OETestDecorator, \ 12from oeqa.core.decorator import decoratorClasses, OETestDecorator, \
13 OETestFilter, OETestDiscover 13 OETestFilter, OETestDiscover
14 14
15def _make_failed_test(classname, methodname, exception, suiteClass): 15if sys.version_info >= (3,4,4):
16 """ 16 def _make_failed_test(classname, methodname, exception, suiteClass):
17 When loading tests, the unittest framework stores any exceptions and 17 """
18 displays them only when the 'run' method is called. 18 When loading tests, the unittest framework stores any exceptions and
19 19 displays them only when the 'run' method is called.
20 For our purposes, it is better to raise the exceptions in the loading 20
21 step rather than waiting to run the test suite. 21 For our purposes, it is better to raise the exceptions in the loading
22 """ 22 step rather than waiting to run the test suite.
23 raise exception 23 """
24 raise exception
25else:
26 def _make_failed_test(classname, exception, suiteClass):
27 raise exception
24unittest.loader._make_failed_test = _make_failed_test 28unittest.loader._make_failed_test = _make_failed_test
25 29
26def _find_duplicated_modules(suite, directory): 30def _find_duplicated_modules(suite, directory):