mirror of
git://git.yoctoproject.org/poky
synced 2026-08-12 19:14:28 +00:00
oeqa/decorators: Use wraps consistently
We want the decorator to leave the function names of the test unchanged. Some decorators are already using wraps for this but not all. Fix this to be consistent allowing inspection of the test to give the wanted values. (From OE-Core rev: 9e4d60b29ff5667d23a89953ce7139b34c11d40b) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
7a93223483
commit
bb44e5b99d
@ -57,6 +57,7 @@ class skipIfFailure(object):
|
||||
self.testcase = testcase
|
||||
|
||||
def __call__(self,f):
|
||||
@wraps(f)
|
||||
def wrapped_f(*args, **kwargs):
|
||||
res = getResults()
|
||||
if self.testcase in (res.getFailList() or res.getErrorList()):
|
||||
@ -71,6 +72,7 @@ class skipIfSkipped(object):
|
||||
self.testcase = testcase
|
||||
|
||||
def __call__(self,f):
|
||||
@wraps(f)
|
||||
def wrapped_f(*args, **kwargs):
|
||||
res = getResults()
|
||||
if self.testcase in res.getSkipList():
|
||||
@ -85,6 +87,7 @@ class skipUnlessPassed(object):
|
||||
self.testcase = testcase
|
||||
|
||||
def __call__(self,f):
|
||||
@wraps(f)
|
||||
def wrapped_f(*args, **kwargs):
|
||||
res = getResults()
|
||||
if self.testcase in res.getSkipList() or \
|
||||
@ -97,11 +100,11 @@ class skipUnlessPassed(object):
|
||||
return wrapped_f
|
||||
|
||||
class testcase(object):
|
||||
|
||||
def __init__(self, test_case):
|
||||
self.test_case = test_case
|
||||
|
||||
def __call__(self, func):
|
||||
@wraps(func)
|
||||
def wrapped_f(*args, **kwargs):
|
||||
return func(*args, **kwargs)
|
||||
wrapped_f.test_case = self.test_case
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user