From 89dfe712570619d3ab3b2bfd522592931d926db1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com>
Date: Fri, 9 Nov 2007 17:40:51 +0000
Subject: [PATCH] improve failures message to include the times

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17503 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Type/tests/testPerformance.py | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/product/ERP5Type/tests/testPerformance.py b/product/ERP5Type/tests/testPerformance.py
index a76ce5b065..5efed742d0 100644
--- a/product/ERP5Type/tests/testPerformance.py
+++ b/product/ERP5Type/tests/testPerformance.py
@@ -113,7 +113,8 @@ class TestPerformance(ERP5TypeTestCase, LogInterceptor):
           print "%s time to view object form %.4f < %.4f < %.4f\n" % \
               (prefix, min, req_time, max)
       if DO_TEST:
-          self.failUnless(min < req_time < max)
+          self.failUnless(min < req_time < max,
+                          '%.4f < %.4f < %.4f' % (min, req_time, max))
 
     def test_00_viewBarObject(self, quiet=quiet, run=run_all_test,
                               min=None, max=None):
@@ -197,9 +198,16 @@ class TestPerformance(ERP5TypeTestCase, LogInterceptor):
             print "\tview = %.4f < %.4f < %.4f" %(min_view, module_value, max_view)
             print
         if DO_TEST:
-            self.failUnless(min_view < module_value < max_view)
-            self.failUnless(MIN_OBJECT_CREATION < add_value < MAX_OBJECT_CREATION)
-            self.failUnless(MIN_TIC < tic_value < MAX_TIC)
+            self.failUnless(min_view < module_value < max_view,
+                            'View: %.4f < %.4f < %.4f' % (
+                            min_view, module_value, max_view))
+            self.failUnless(
+                 MIN_OBJECT_CREATION < add_value < MAX_OBJECT_CREATION,
+                'Create: %.4f < %.4f < %.4f' % (
+                 MIN_OBJECT_CREATION, add_value, MAX_OBJECT_CREATION))
+            self.failUnless(MIN_TIC < tic_value < MAX_TIC,
+                            'Tic: %.4f < %.4f < %.4f' % (
+                            MIN_TIC, tic_value, MAX_TIC))
         i += 1
 
 def test_suite():
-- 
2.30.9