home contents changes options help subscribe edit (external edit)

doctest.py is a lightweight "literate programming"-style testing framework for python. Released by Tim Peters in 1999, not used much in Zope 2, but now part of the python standard library and making a comeback in the Zope 3 project.

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.

Doctest is part of the Python standard library. Full documentation and examples are provided in the library documentation.



subject:
  ( 23 subscribers )