[oe-commits] Richard Purdie : oeqa/sstatettests: Improve output of assert

git at git.openembedded.org git at git.openembedded.org
Tue Sep 8 22:56:26 UTC 2015


Module: openembedded-core.git
Branch: master-next
Commit: 2bfc61c1cd0a76afd0efa258efdd37ed7c92c378
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=2bfc61c1cd0a76afd0efa258efdd37ed7c92c378

Author: Richard Purdie <richard.purdie at linuxfoundation.org>
Date:   Mon Sep  7 20:24:28 2015 +0100

oeqa/sstatettests: Improve output of assert

Currently if this fails you see:

"AssertionError: 1 != 0"

which is useless. Add the output of the failed command so we can stand
some chance of debugging what went wrong.

Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

 meta/lib/oeqa/selftest/sstatetests.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/lib/oeqa/selftest/sstatetests.py b/meta/lib/oeqa/selftest/sstatetests.py
index 1ce8773..6906b21 100644
--- a/meta/lib/oeqa/selftest/sstatetests.py
+++ b/meta/lib/oeqa/selftest/sstatetests.py
@@ -153,7 +153,7 @@ class SStateTests(SStateBase):
                 expected_remaining_sstate += [x for x in target_sstate_after_build if x not in target_sstate_before_build if not any(pattern in x for pattern in ignore_patterns)]
             self.remove_config(global_config[idx])
             self.remove_recipeinc(target, target_config[idx])
-            self.assertEqual(result.status, 0)
+            self.assertEqual(result.status, 0, msg = "build of %s failed with %s" % (target, result.output))
 
         runCmd("sstate-cache-management.sh -y --cache-dir=%s --remove-duplicated --extra-archs=%s" % (self.sstate_path, ','.join(map(str, sstate_archs_list))))
         actual_remaining_sstate = [x for x in self.search_sstate(target + '.*?\.tgz$') if not any(pattern in x for pattern in ignore_patterns)]



More information about the Openembedded-commits mailing list