Rev 2445: assertEqual can take an option message in file:///home/mbp/bzr/Work/subtree/
Martin Pool
mbp at sourcefrog.net
Mon Mar 5 06:45:05 GMT 2007
------------------------------------------------------------
revno: 2445
revision-id: mbp at sourcefrog.net-20070305064503-mf6hwihhvgnf88wg
parent: mbp at sourcefrog.net-20070305063046-unnu602hw4j5jgrq
committer: Martin Pool <mbp at sourcefrog.net>
branch nick: subtree
timestamp: Mon 2007-03-05 17:45:03 +1100
message:
assertEqual can take an option message
modified:
bzrlib/tests/__init__.py selftest.py-20050531073622-8d0e3c8845c97a64
=== modified file 'bzrlib/tests/__init__.py'
--- a/bzrlib/tests/__init__.py 2007-03-05 05:58:05 +0000
+++ b/bzrlib/tests/__init__.py 2007-03-05 06:45:03 +0000
@@ -601,11 +601,14 @@
charjunk=lambda x: False)
return ''.join(difflines)
- def assertEqual(self, a, b):
+ def assertEqual(self, a, b, message=''):
if a == b:
return
- raise AssertionError("not equal:\na = %s\nb = %s\n"
- % (pformat(a, indent=4), pformat(b, indent=4)))
+ if message:
+ message += '\n'
+ raise AssertionError("%snot equal:\na = %s\nb = %s\n"
+ % (message,
+ pformat(a, indent=4), pformat(b, indent=4)))
assertEquals = assertEqual
More information about the bazaar-commits
mailing list