A better unittest
Thomas Heller
theller at python.net
Wed Apr 16 15:18:38 EDT 2003
Alex Martelli <aleax at aleax.it> writes:
> Thomas Heller wrote:
> ...
> > Hm, the latest version of the patch which I posted typically prints this:
> >
> > ======================================================================
> > FAIL: test_failUnlessEqual (__main__.FailingTests)
> > ----------------------------------------------------------------------
> > TestFailed: 0 != 1
> > File "xunit.py", line 12, in test_failUnlessEqual
> > self.failUnlessEqual(self.a, self.b)
> >
> > Is this poorly formatted? I won't argue about this.
>
> It's sure WAY better than what it does out of the box!!!
>
> > Anyway, this is IMO the information I want to have:
> > filename, line number, source code line, and the actual#
> > values which made the test fail.
>
> Seconded.
>
> > Concerning the 'more is better': If the test crashes (raises an
> > unexpected exception), the full traceback is printed.
> > If the test fails because a condition is not fulfilled, I'm *not*
> > interested to see how unittest raises this error.
>
> Absolutely!!! I think unittest would be MUCH better with
> your mods.
Given your and the other positive responses, and ignoring the negative
responses ;-), I have posted it to the Python patch manager:
http://www.python.org/sf/722638
Thomas
More information about the Python-list
mailing list