summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa
diff options
context:
space:
mode:
authorMariano Lopez <mariano.lopez@linux.intel.com>2017-02-27 07:45:00 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-03-01 23:27:10 +0000
commit9f8748c59fe418b1f386854d8df71142a789822b (patch)
tree6cd2571ccf3358dc2f447cdcf04381def8dad60f /meta/lib/oeqa
parent21eb3e07c6881682b681106c8590237f45c52a93 (diff)
downloadpoky-9f8748c59fe418b1f386854d8df71142a789822b.tar.gz
oeqa/core/loader.py: Give meaningful error when failed to load classes
With this we get the class that is actually having the problem, not just a TypeError with an unknown class causing the error. (From OE-Core rev: d6ff4891376417504018af27e8e729a412feeeea) Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa')
-rw-r--r--meta/lib/oeqa/core/loader.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/meta/lib/oeqa/core/loader.py b/meta/lib/oeqa/core/loader.py
index a38032590d..b9ba9235af 100644
--- a/meta/lib/oeqa/core/loader.py
+++ b/meta/lib/oeqa/core/loader.py
@@ -171,11 +171,11 @@ class OETestLoader(unittest.TestLoader):
171 """ 171 """
172 if issubclass(testCaseClass, unittest.suite.TestSuite): 172 if issubclass(testCaseClass, unittest.suite.TestSuite):
173 raise TypeError("Test cases should not be derived from TestSuite." \ 173 raise TypeError("Test cases should not be derived from TestSuite." \
174 " Maybe you meant to derive from TestCase?") 174 " Maybe you meant to derive %s from TestCase?" \
175 % testCaseClass.__name__)
175 if not issubclass(testCaseClass, self.caseClass): 176 if not issubclass(testCaseClass, self.caseClass):
176 raise TypeError("Test cases need to be derived from %s" % \ 177 raise TypeError("Test %s is not derived from %s" % \
177 self.caseClass.__name__) 178 (testCaseClass.__name__, self.caseClass.__name__))
178
179 179
180 testCaseNames = self.getTestCaseNames(testCaseClass) 180 testCaseNames = self.getTestCaseNames(testCaseClass)
181 if not testCaseNames and hasattr(testCaseClass, 'runTest'): 181 if not testCaseNames and hasattr(testCaseClass, 'runTest'):