[gnome-continuous-yocto/gnomeostree-3.28-rocko: 6440/8267] oeqa/core/loader.py: Fix _make_failed_test for python >= 3.4.4
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-continuous-yocto/gnomeostree-3.28-rocko: 6440/8267] oeqa/core/loader.py: Fix _make_failed_test for python >= 3.4.4
- Date: Sun, 17 Dec 2017 04:50:52 +0000 (UTC)
commit d8380d098a290510b442a7abd2dd5a50cabf5844
Author: Aníbal Limón <anibal limon linux intel com>
Date: Thu Jun 15 17:09:49 2017 -0500
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>
meta/lib/oeqa/core/loader.py | 22 +++++++++++++---------
1 files changed, 13 insertions(+), 9 deletions(-)
---
diff --git a/meta/lib/oeqa/core/loader.py b/meta/lib/oeqa/core/loader.py
index 229f094..80e3d28 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
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):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]