mirror of
https://git.yoctoproject.org/poky
synced 2026-06-01 13:09:50 +00:00
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>
This commit is contained in:
committed by
Richard Purdie
parent
aa6e333de9
commit
d8380d098a
@@ -12,15 +12,19 @@ from oeqa.core.case import OETestCase
|
|||||||
from oeqa.core.decorator import decoratorClasses, OETestDecorator, \
|
from oeqa.core.decorator import decoratorClasses, OETestDecorator, \
|
||||||
OETestFilter, OETestDiscover
|
OETestFilter, OETestDiscover
|
||||||
|
|
||||||
def _make_failed_test(classname, methodname, exception, suiteClass):
|
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.
|
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
|
For our purposes, it is better to raise the exceptions in the loading
|
||||||
step rather than waiting to run the test suite.
|
step rather than waiting to run the test suite.
|
||||||
"""
|
"""
|
||||||
raise exception
|
raise exception
|
||||||
|
else:
|
||||||
|
def _make_failed_test(classname, exception, suiteClass):
|
||||||
|
raise exception
|
||||||
unittest.loader._make_failed_test = _make_failed_test
|
unittest.loader._make_failed_test = _make_failed_test
|
||||||
|
|
||||||
def _find_duplicated_modules(suite, directory):
|
def _find_duplicated_modules(suite, directory):
|
||||||
|
|||||||
Reference in New Issue
Block a user