mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-04-28 01:54:42 +00:00
better equality assert message
git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@3027 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
parent
0a257847e3
commit
8719ed81e0
1 changed files with 7 additions and 1 deletions
|
|
@ -41,7 +41,13 @@ class StandardTest (unittest.TestCase):
|
|||
accordingly.
|
||||
"""
|
||||
if msg is None:
|
||||
msg = "got %r, expected %r" % (first, second)
|
||||
r1 = repr(first)
|
||||
r2 = repr(second)
|
||||
if len(r1) > 40 or len(r2) > 40:
|
||||
sep = "\n"
|
||||
else:
|
||||
sep = ", "
|
||||
msg = "got %s%sexpected %s" % (r1, sep, r2)
|
||||
super(StandardTest, self).failUnlessEqual(first, second, msg=msg)
|
||||
|
||||
assertEqual = assertEquals = failUnlessEqual
|
||||
|
|
|
|||
Loading…
Reference in a new issue