Differences between revisions 2 and 4 (spanning 2 versions)
Revision 2 as of 2005-04-02 13:42:44
Size: 479
Editor: 207
Comment:
Revision 4 as of 2007-05-20 00:53:28
Size: 708
Editor: CameronLaird
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
 * [http://docs.python.org/lib/module-doctest.html doctest module] -- (python standard issue)
Line 6: Line 8:


A [http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/305292 nice example of Doctest use] appears in
the PythonCookBook.

doctest.py is a lightweight "literate programming"-style testing framework for python. Released by Tim Peters in 1999 now part of the python standard library.

You define a test by executing some code in an interactive session, and then pasting it along with the output into a nearby docstring. When you run your module at the command-line, doctest executes each one of these code examples, compares the expected and actual output and provides a report.

See also UnitTests

A [http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/305292 nice example of Doctest use] appears in the PythonCookBook.

DocTest (last edited 2008-11-15 14:00:00 by localhost)

Unable to edit the page? See the FrontPage for instructions.