[Python-Dev] Unit testing (again)

Michel Pelletier michel@digicool.com
Tue, 13 Feb 2001 14:54:58 -0800 (PST)


On Tue, 13 Feb 2001, Fredrik Lundh wrote:

> tim wrote:
> > I will immodestly claim that if doctest is sufficient for your testing
> > purposes, you're never going to find anything easier or faster or more
> > natural to use
> 
> you know, just having taken another look at doctest
> and the unit test options, I'm tempted to agree.

I also agree that doctest is the bee's knees, but I don't think it is
quite as useful for us as PyUnit (for other people, I'm sure it's 
very useful).  

One of the goals of our interface work is to associate unit tests with
interfaces.  I don't see how doctest can work well with that.  I probably
need to look at it more, but one of our end goals is to walk up to a
component, push a button, and have that components interfaces test the
component while the system is live.  I immagine this involving a bit of
external framework at the interface level that would be pretty easy with
PyUnit, I've only seen one example of doctest and it looks like you run it
against an imported module.  I don't see how this helps us with
our (DC's) definition of components.

A personal issue for me is that it overloads the docstring, no
biggy, but it's just a personal nit I don't particularly like about 
doctest.

Another issue is documentation.  I don't know how much documentation
doctest has, but PyUnit's documentation is *superb* and there are no
suprises, which is absolutely +1.  Quixote's documentation seems very thin
(please correct me if I'm wrong).  PyUnit's documentation goes beyond just
explaning the software into explaining common patterns and unit testing
philosophies.

-Michel