From 0c4dd0ad168e138ba96eaf27aa7e513aaf6704ee Mon Sep 17 00:00:00 2001 From: Lucian Musat Date: Thu, 24 Jul 2014 15:41:24 +0300 Subject: oeqa: Refactor test skipping decorators to use the unittest result object In order to make the test skipping decorators independent of the oeTest object we rely on the unittest result object to construct skip, fail and error lists used by these decorators. Created a new object getResults that analyses upper frames and retrieves the unittest result object instance, then return a list of failed, skipped and error tests. Also removed the oetest import from decorators.py because it was no longer required. (From OE-Core rev: 4d2d201158236bd4c72546cf8db88681ff921b11) Signed-off-by: Lucian Musat Signed-off-by: Saul Wold Signed-off-by: Richard Purdie --- meta/lib/oeqa/oetest.py | 17 ----------------- 1 file changed, 17 deletions(-) (limited to 'meta/lib/oeqa/oetest.py') diff --git a/meta/lib/oeqa/oetest.py b/meta/lib/oeqa/oetest.py index 0db6cb80a9..ecb8e53705 100644 --- a/meta/lib/oeqa/oetest.py +++ b/meta/lib/oeqa/oetest.py @@ -11,7 +11,6 @@ import os, re, mmap import unittest import inspect - def loadTests(tc): # set the context object passed from the test class @@ -36,24 +35,9 @@ def runTests(tc): return result - class oeTest(unittest.TestCase): longMessage = True - testFailures = [] - testSkipped = [] - testErrors = [] - - def run(self, result=None): - super(oeTest, self).run(result) - - # we add to our own lists the results, we use those for decorators - if len(result.failures) > len(oeTest.testFailures): - oeTest.testFailures.append(str(result.failures[-1][0]).split()[0]) - if len(result.skipped) > len(oeTest.testSkipped): - oeTest.testSkipped.append(str(result.skipped[-1][0]).split()[0]) - if len(result.errors) > len(oeTest.testErrors): - oeTest.testErrors.append(str(result.errors[-1][0]).split()[0]) @classmethod def hasPackage(self, pkg): @@ -71,7 +55,6 @@ class oeTest(unittest.TestCase): else: return False - class oeRuntimeTest(oeTest): def __init__(self, methodName='runTest'): -- cgit v1.2.3-54-g00ecf