diff options
Diffstat (limited to 'meta')
-rw-r--r-- | meta/lib/oeqa/core/context.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/meta/lib/oeqa/core/context.py b/meta/lib/oeqa/core/context.py index 09627044c8..58244895af 100644 --- a/meta/lib/oeqa/core/context.py +++ b/meta/lib/oeqa/core/context.py | |||
@@ -9,6 +9,7 @@ import json | |||
9 | import time | 9 | import time |
10 | import logging | 10 | import logging |
11 | import collections | 11 | import collections |
12 | import unittest | ||
12 | 13 | ||
13 | from oeqa.core.loader import OETestLoader | 14 | from oeqa.core.loader import OETestLoader |
14 | from oeqa.core.runner import OETestRunner | 15 | from oeqa.core.runner import OETestRunner |
@@ -45,10 +46,14 @@ class OETestContext(object): | |||
45 | def skipTests(self, skips): | 46 | def skipTests(self, skips): |
46 | if not skips: | 47 | if not skips: |
47 | return | 48 | return |
49 | def skipfuncgen(skipmsg): | ||
50 | def func(): | ||
51 | raise unittest.SkipTest(skipmsg) | ||
52 | return func | ||
48 | for test in self.suites: | 53 | for test in self.suites: |
49 | for skip in skips: | 54 | for skip in skips: |
50 | if test.id().startswith(skip): | 55 | if test.id().startswith(skip): |
51 | setattr(test, 'setUp', lambda: test.skipTest('Skip by the command line argument "%s"' % skip)) | 56 | setattr(test, 'setUp', skipfuncgen('Skip by the command line argument "%s"' % skip)) |
52 | 57 | ||
53 | def loadTests(self, module_paths, modules=[], tests=[], | 58 | def loadTests(self, module_paths, modules=[], tests=[], |
54 | modules_manifest="", modules_required=[], filters={}): | 59 | modules_manifest="", modules_required=[], filters={}): |