summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/lib/oeqa/core/context.py7
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
9import time 9import time
10import logging 10import logging
11import collections 11import collections
12import unittest
12 13
13from oeqa.core.loader import OETestLoader 14from oeqa.core.loader import OETestLoader
14from oeqa.core.runner import OETestRunner 15from 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={}):