summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2015-10-26 13:28:26 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-10-27 07:24:30 +0000
commitfdfdfc8ccb96ce8f2d4b9644d182b1e1a5a6af28 (patch)
tree5f0e6e15df7cb037037a6e16816eff482e745e9f /meta
parenta2d5b7ac76c13b07a6840415a8c1202e3afa79a8 (diff)
downloadpoky-fdfdfc8ccb96ce8f2d4b9644d182b1e1a5a6af28.tar.gz
oeqa/utils/decorators: fix missing keyword arguments on decorators
We need to handle keyword arguments here or sending a keyword argument to a decorated function that accepts keyword arguments will trigger an error. (This showed up when testcase decorators were added to the recipetool.RecipetoolTests.test_recipetool_appendsrcfiles_basic_subdir test). (From OE-Core rev: f787b688f2884ce3fa888b4041030538c7d2bf55) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/lib/oeqa/utils/decorators.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/meta/lib/oeqa/utils/decorators.py b/meta/lib/oeqa/utils/decorators.py
index 2169a20884..0d79223a29 100644
--- a/meta/lib/oeqa/utils/decorators.py
+++ b/meta/lib/oeqa/utils/decorators.py
@@ -57,11 +57,11 @@ class skipIfFailure(object):
57 self.testcase = testcase 57 self.testcase = testcase
58 58
59 def __call__(self,f): 59 def __call__(self,f):
60 def wrapped_f(*args): 60 def wrapped_f(*args, **kwargs):
61 res = getResults() 61 res = getResults()
62 if self.testcase in (res.getFailList() or res.getErrorList()): 62 if self.testcase in (res.getFailList() or res.getErrorList()):
63 raise unittest.SkipTest("Testcase dependency not met: %s" % self.testcase) 63 raise unittest.SkipTest("Testcase dependency not met: %s" % self.testcase)
64 return f(*args) 64 return f(*args, **kwargs)
65 wrapped_f.__name__ = f.__name__ 65 wrapped_f.__name__ = f.__name__
66 return wrapped_f 66 return wrapped_f
67 67
@@ -71,11 +71,11 @@ class skipIfSkipped(object):
71 self.testcase = testcase 71 self.testcase = testcase
72 72
73 def __call__(self,f): 73 def __call__(self,f):
74 def wrapped_f(*args): 74 def wrapped_f(*args, **kwargs):
75 res = getResults() 75 res = getResults()
76 if self.testcase in res.getSkipList(): 76 if self.testcase in res.getSkipList():
77 raise unittest.SkipTest("Testcase dependency not met: %s" % self.testcase) 77 raise unittest.SkipTest("Testcase dependency not met: %s" % self.testcase)
78 return f(*args) 78 return f(*args, **kwargs)
79 wrapped_f.__name__ = f.__name__ 79 wrapped_f.__name__ = f.__name__
80 return wrapped_f 80 return wrapped_f
81 81
@@ -85,13 +85,13 @@ class skipUnlessPassed(object):
85 self.testcase = testcase 85 self.testcase = testcase
86 86
87 def __call__(self,f): 87 def __call__(self,f):
88 def wrapped_f(*args): 88 def wrapped_f(*args, **kwargs):
89 res = getResults() 89 res = getResults()
90 if self.testcase in res.getSkipList() or \ 90 if self.testcase in res.getSkipList() or \
91 self.testcase in res.getFailList() or \ 91 self.testcase in res.getFailList() or \
92 self.testcase in res.getErrorList(): 92 self.testcase in res.getErrorList():
93 raise unittest.SkipTest("Testcase dependency not met: %s" % self.testcase) 93 raise unittest.SkipTest("Testcase dependency not met: %s" % self.testcase)
94 return f(*args) 94 return f(*args, **kwargs)
95 wrapped_f.__name__ = f.__name__ 95 wrapped_f.__name__ = f.__name__
96 wrapped_f._depends_on = self.testcase 96 wrapped_f._depends_on = self.testcase
97 return wrapped_f 97 return wrapped_f
@@ -102,8 +102,8 @@ class testcase(object):
102 self.test_case = test_case 102 self.test_case = test_case
103 103
104 def __call__(self, func): 104 def __call__(self, func):
105 def wrapped_f(*args): 105 def wrapped_f(*args, **kwargs):
106 return func(*args) 106 return func(*args, **kwargs)
107 wrapped_f.test_case = self.test_case 107 wrapped_f.test_case = self.test_case
108 wrapped_f.__name__ = func.__name__ 108 wrapped_f.__name__ = func.__name__
109 return wrapped_f 109 return wrapped_f