[OE-core] [PATCH 1/2] oeqa/core/loader.py: Give meaningful error when failed to load classes
mariano.lopez at linux.intel.com
mariano.lopez at linux.intel.com
Fri Feb 10 14:15:56 UTC 2017
From: Mariano Lopez <mariano.lopez at linux.intel.com>
With this we get the class that is actually having the problem,
not just a TypeError with an unknown class causing the error.
Signed-off-by: Mariano Lopez <mariano.lopez at linux.intel.com>
---
meta/lib/oeqa/core/loader.py | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/meta/lib/oeqa/core/loader.py b/meta/lib/oeqa/core/loader.py
index c73ef9a..bf13a5a 100644
--- a/meta/lib/oeqa/core/loader.py
+++ b/meta/lib/oeqa/core/loader.py
@@ -171,10 +171,11 @@ class OETestLoader(unittest.TestLoader):
"""
if issubclass(testCaseClass, unittest.suite.TestSuite):
raise TypeError("Test cases should not be derived from TestSuite." \
- " Maybe you meant to derive from TestCase?")
+ " Maybe you meant to derive %s from TestCase?" \
+ % testCaseClass.__name__)
if not issubclass(testCaseClass, self.caseClass):
- raise TypeError("Test cases need to be derived from %s" % \
- caseClass.__name__)
+ raise TypeError("Test %s is not derived from %s" % \
+ (testCaseClass.__name__, self.caseClass.__name__))
testCaseNames = self.getTestCaseNames(testCaseClass)
--
2.6.6
More information about the Openembedded-core
mailing list