doctest, unittest, or if __name__='__main__'

Christoph Zwerschke cito at online.de
Tue Mar 21 16:26:57 EST 2006


john_sips_tea at yahoo.com wrote:
> If unittest is the standard way to write test code, why do we still
> have doctest? (I notice there's no mention in PEP 3000 of deprecating
> the doctest module).

Because both have their pros and cons and their right to exist. Doctest 
is really easy to use and you can kill two birds with one stone.

Rather than removing one of the two, I would like to see yet another 
alternatise such as py.test in the standard lib, because unittest is 
indeed standard, but clumsy and un-pythonic.

-- Christoph






More information about the Python-list mailing list