[Erp5-report] r40605 kazuhiko - /erp5/trunk/buildout/tests/assertSoftware.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Wed Nov 24 16:58:28 CET 2010
Author: kazuhiko
Date: Wed Nov 24 16:58:27 2010
New Revision: 40605
URL: http://svn.erp5.org?rev=40605&view=rev
Log:
display specified msg too.
Modified:
erp5/trunk/buildout/tests/assertSoftware.py
Modified: erp5/trunk/buildout/tests/assertSoftware.py
URL: http://svn.erp5.org/erp5/trunk/buildout/tests/assertSoftware.py?rev=40605&r1=40604&r2=40605&view=diff
==============================================================================
--- erp5/trunk/buildout/tests/assertSoftware.py [utf8] (original)
+++ erp5/trunk/buildout/tests/assertSoftware.py [utf8] Wed Nov 24 16:58:27 2010
@@ -139,20 +139,22 @@ class AssertSoftwareMixin(unittest.TestC
try:
return unittest.TestCase.assertEqual(self, first, second, msg=msg)
except unittest.TestCase.failureException:
- if (msg is None) and \
- isinstance(first, list) and \
+ if isinstance(first, list) and \
isinstance(second, list):
- msg = ''
+ err = ''
for elt in first:
if elt not in second:
- msg += '- %s\n' % elt
+ err += '- %s\n' % elt
for elt in second:
if elt not in first:
- msg += '+ %s\n' % elt
- if msg == '':
+ err += '+ %s\n' % elt
+ if err == '':
raise
else:
- msg = 'Lists are different:\n%s' % msg
+ if msg:
+ msg = '%s: Lists are different:\n%s' % (msg, err)
+ else:
+ msg = 'Lists are different:\n%s' % err
raise unittest.TestCase.failureException, msg
else:
raise
More information about the Erp5-report
mailing list