Re: doctest or pyunit?
by Fredrik Lundh other posts by this author
May 2 2001 11:55PM messages near this date
RE: doctest or pyunit?
|
detect terminal width
Bruce Edge wrote:
> Is doctest going to be updated to use 2.1's method attributes rather than
> the doc string?
given that doctest is designed to make sure your *documentation*
is correct, that sounds like a really lousy idea ;-)
but it works well for unit-testing too: write a test program that
exercises relevant parts of your module, and use doctest to make
sure *that* program works as expected.
in my experience (having tried pyunit, several homebrewn frameworks,
including ports of the original smalltalk framework, greg's unittest, and
doctest), using doctest on test scripts beats all other approaches.
less code, less work, easier to debug the tests. ymmv, as usual.
Cheers /F
<!-- (the eff-bot guide to) the standard python library:
http://www.pythonware.com/people/fredrik/librarybook.htm
(electronic edition now available from amazon.com!)
-->
--
http://mail.python.org/mailman/listinfo/python-list
Thread:
Bruce Edge
Alex Martelli
Tim Peters
Fredrik Lundh
|