Re: [Pyunit-interest] PATCH: AssertionError message
Brought to you by:
purcell
From: Phlip <ppl...@om...> - 2002-06-03 17:39:09
|
Alexander Garden sez: > - raise self.failureException, (msg or '%s != %s' % (first, > second)) + raise self.failureException, (msg or '%s != %s' % ( > repr(first), repr(second) )) I second this patch. The repr, for strings, will reveal sneaky characters like \011 or \014 or \000. For objects, folks want __str__ to report an object's cosmetic state to end-users, but __repr__ to report its technical state. I sometimes make __repr__ return a string which, if eval'd, would construct an identical object. -- Phlip http://www.greencheese.org/HatTrick "Solutions are not the answer." -- Richard Nixon |