unittest vs py.test?

Peter Hansen peter at engcorp.com
Tue Apr 5 10:42:33 EDT 2005


Michael Hudson wrote:
> Peter Hansen <peter at engcorp.com> writes:
>>Where was all that weight that unittest supposedly
>>has?
> 
> For PyPy we wanted to do some things that the designers of unittest
> obviously hadn't expected[1], such as formatting tracebacks
> differently.  This was pretty tedious to do[2], 

I'd agree with that!  The guts of unittest I find to
be somewhat opaque, and not straightforward to extend.
Trying to do so here has also proven tedious, though
ultimately feasible, as you say the PyPy folks have
found.

Which, in the end, is precisely why I just use the
simplest vanilla approach that I can, no different
than anything done, for example, in the excellent
chapter on testing in http://www.diveintopython.org
or other examples of using unittest.

unitttest is surely not the be all and end all of
Python unit testing frameworks...  but it's one of
the batteries included in the standard distribution,
and it's pretty trivial to get started using it,
unless maybe you try to go by the documentation instead
of by the examples...

-Peter



More information about the Python-list mailing list