[oe-commits] [openembedded-core] 75/91: oeqa/core/loader.py: Give meaningful error when failed to load classes

git at git.openembedded.org git at git.openembedded.org
Wed Mar 1 12:56:57 UTC 2017


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit 22612968e6d49b843bcc66ff99346d30b3a36a26
Author: Mariano Lopez <mariano.lopez at linux.intel.com>
AuthorDate: Mon Feb 27 07:45:00 2017 +0000

    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.
    
    Signed-off-by: Mariano Lopez <mariano.lopez at linux.intel.com>
    Signed-off-by: Ross Burton <ross.burton at intel.com>
---
 meta/lib/oeqa/core/loader.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/meta/lib/oeqa/core/loader.py b/meta/lib/oeqa/core/loader.py
index a380325..b9ba923 100644
--- a/meta/lib/oeqa/core/loader.py
+++ b/meta/lib/oeqa/core/loader.py
@@ -171,11 +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" % \
-                    self.caseClass.__name__)
-
+            raise TypeError("Test %s is not derived from %s" % \
+                    (testCaseClass.__name__, self.caseClass.__name__))
 
         testCaseNames = self.getTestCaseNames(testCaseClass)
         if not testCaseNames and hasattr(testCaseClass, 'runTest'):

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list