mirror of
git://git.yoctoproject.org/poky
synced 2026-09-08 22:02:19 +00:00
Some skip decorators meant only for test methods, providing some kind of test methods dependency. They are used together with a test method name not a condition. These are complementary to python's unittest skip decorators. (From OE-Core rev: 79cb89648702aa80ec986e0026c62948de905b87) Signed-off-by: Radu Moisan <radu.moisan@intel.com> Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
41 lines
1.3 KiB
Python
41 lines
1.3 KiB
Python
from oeqa.oetest import *
|
|
|
|
class skipIfFailure(object):
|
|
|
|
def __init__(self,testcase):
|
|
self.testcase = testcase
|
|
|
|
def __call__(self,f):
|
|
def wrapped_f(*args):
|
|
if self.testcase in (oeRuntimeTest.testFailures or oeRuntimeTest.testErrors):
|
|
raise unittest.SkipTest("Testcase dependency not met: %s" % self.testcase)
|
|
f(*args)
|
|
wrapped_f.__name__ = f.__name__
|
|
return wrapped_f
|
|
|
|
class skipIfSkipped(object):
|
|
|
|
def __init__(self,testcase):
|
|
self.testcase = testcase
|
|
|
|
def __call__(self,f):
|
|
def wrapped_f(*args):
|
|
if self.testcase in oeRuntimeTest.testSkipped:
|
|
raise unittest.SkipTest("Testcase dependency not met: %s" % self.testcase)
|
|
f(*args)
|
|
wrapped_f.__name__ = f.__name__
|
|
return wrapped_f
|
|
|
|
class skipUnlessPassed(object):
|
|
|
|
def __init__(self,testcase):
|
|
self.testcase = testcase
|
|
|
|
def __call__(self,f):
|
|
def wrapped_f(*args):
|
|
if self.testcase in (oeRuntimeTest.testSkipped, oeRuntimeTest.testFailures, oeRuntimeTest.testErrors):
|
|
raise unittest.SkipTest("Testcase dependency not met: %s" % self.testcase)
|
|
f(*args)
|
|
wrapped_f.__name__ = f.__name__
|
|
return wrapped_f
|