diff options
-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 import time import logging import collections +import unittest from oeqa.core.loader import OETestLoader from oeqa.core.runner import OETestRunner @@ -45,10 +46,14 @@ class OETestContext(object): def skipTests(self, skips): if not skips: return + def skipfuncgen(skipmsg): + def func(): + raise unittest.SkipTest(skipmsg) + return func for test in self.suites: for skip in skips: if test.id().startswith(skip): - setattr(test, 'setUp', lambda: test.skipTest('Skip by the command line argument "%s"' % skip)) + setattr(test, 'setUp', skipfuncgen('Skip by the command line argument "%s"' % skip)) def loadTests(self, module_paths, modules=[], tests=[], modules_manifest="", modules_required=[], filters={}): |