[TIP] Doctest or unitest?

Max Ischenko ischenko at gmail.com
Mon Mar 5 05:59:29 PST 2007


On 3/5/07, Andrew Bennetts <andrew-tip at puzzling.org> wrote:
> The other good use is as testable *documentation*, with the emphasis on
> documentation.  If a doctest file is primarily there to provide test
> coverage,
> rather than explaining how to use something, then in my experience it's
> probably
> in the wrong format.

This has been my experience as well.

Personally, I rarely view 'doctests' as tests; any executable code I put
into docstrings is meant to be a part of documentation. Of course, it nice
that doctest/nose can make sure these code samples never get out of sync
with the code but these samlple are no substitute for extensive test suite.

All my 'real' tests are separate python modules, written for nose/unittest

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.idyll.org/pipermail/testing-in-python/attachments/20070305/af15140b/attachment.htm 

More information about the testing-in-python mailing list