[gobject-introspection] [warningtester] Prettify error output



commit e262dcaf557df83bd40572a8f94032a4da6148c5
Author: Johan Dahlin <johan gnome org>
Date:   Thu Sep 23 19:11:59 2010 -0300

    [warningtester] Prettify error output

 tests/warn/warningtester.py |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/tests/warn/warningtester.py b/tests/warn/warningtester.py
index 2948c74..d43b6d5 100644
--- a/tests/warn/warningtester.py
+++ b/tests/warn/warningtester.py
@@ -108,8 +108,12 @@ def check(args):
         warnings.remove('')
     if len(expected_warnings) != len(warnings):
         raise SystemExit(
-            "ERROR: expected %d warnings, but got %d: %r\n" % (
-            len(expected_warnings), len(warnings), warnings))
+            "ERROR in %r: expected %d warnings, but got %d:\n"
+            "----\nexpected:\n%s\n----\ngot:\n%s\n----" % (
+            os.path.basename(filename),
+            len(expected_warnings), len(warnings),
+            '\n'.join([w[1] for w in expected_warnings]),
+            '\n'.join([w.split(':', 2)[2][1:] for w in warnings])))
     for warning, (sort_key, expected) in zip(warnings, expected_warnings):
         actual = warning.split(":", 1)[1]
         if _diff(expected, actual, filename):



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]