A better unittest

Terry Reedy tjreedy at udel.edu
Wed Apr 16 19:36:03 CEST 2003


"Thomas Heller" <theller at python.net> wrote in message
news:n0iqy1zg.fsf at python.net...
======================================================================
> FAIL: test_failUnlessEqual (__main__.FailingTests)
> --------------------------------------------------------------------
--
> TestFailed: 0 != 1
>   File "xunit.py", line 12, in test_failUnlessEqual
>     self.failUnlessEqual(self.a, self.b)

I like having the actual values too.  It should make debugging an
unexpected failure easier.  But what if each value is more that a few
bytes?  Example (from my future plans): two lists of all permutations
of range(8), one produced by an obvious recursion and the other by a
much less obvious iteration.

Hmmm.  What I would really like is a structure comparison function
that spit out the first difference found  so I did not have to print
each and compare by eye.  That is not directly in the scope of your
problem, but it would be the most useful succinct display.

Terry J. Reedy







More information about the Python-list mailing list