aboutsummaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/utils/decorators.py
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2014-12-23 14:47:45 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-12-25 08:27:12 +0000
commit7d9b5fb69ab5012f99d5fb6edc263df00e9467f5 (patch)
treee7ad1a6151d3c332ee7485a07c895d05daec3055 /meta/lib/oeqa/utils/decorators.py
parentd4d73b0139d7cdd490b0e7d783c9bab61446f995 (diff)
downloadopenembedded-core-contrib-7d9b5fb69ab5012f99d5fb6edc263df00e9467f5.tar.gz
oeqa/utils: fix testcase decorator to allow calling tests individually
Without this, running tests individually failed with a traceback: $ oe-selftest --run-test buildoptions.ImageOptionsTests.test_incremental_image_generation 2014-12-23 14:40:37,636 - selftest - INFO - Checking that everything is in order before running the tests 2014-12-23 14:40:38,408 - selftest - INFO - Running bitbake -p 2014-12-23 14:40:40,235 - selftest - INFO - Loading tests from: oeqa.selftest.buildoptions.ImageOptionsTests.test_incremental_image_generation Traceback (most recent call last): File "/home/user/poky/scripts/oe-selftest", line 179, in <module> ret = main() File "/home/user/poky/scripts/oe-selftest", line 164, in main suite.addTests(loader.loadTestsFromName(test)) File "/usr/lib64/python2.7/unittest/loader.py", line 91, in loadTestsFromName module = __import__('.'.join(parts_copy)) File "/home/user/poky/meta/lib/oeqa/selftest/buildoptions.py", line 12, in <module> class ImageOptionsTests(oeSelfTest): File "/home/user/poky/meta/lib/oeqa/selftest/buildoptions.py", line 14, in ImageOptionsTests @testcase(761) NameError: global name 'func' is not defined (From OE-Core rev: 8e3fbb0bb2c0eabfb39752c25e7c3f5d77881f64) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/utils/decorators.py')
-rw-r--r--meta/lib/oeqa/utils/decorators.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/meta/lib/oeqa/utils/decorators.py b/meta/lib/oeqa/utils/decorators.py
index 1ae1162e33..2d5db2474a 100644
--- a/meta/lib/oeqa/utils/decorators.py
+++ b/meta/lib/oeqa/utils/decorators.py
@@ -89,6 +89,7 @@ class testcase(object):
def wrapped_f(*args):
return func(*args)
wrapped_f.test_case = self.test_case
+ wrapped_f.__name__ = func.__name__
return wrapped_f
class NoParsingFilter(logging.Filter):
' href='#n241'>241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305