Cameron Laird's personal notes on Python testing

I started this page to amplify a lovely explanation Tim Peters posted to comp.lang.python, on his doctest invention. That original posting seems now to be lost. At some point, I'll make one more grand effort to locate a copy.

Steve Purcell's PyUnit and Tim's doctest are both part of the 2.1 release, as Stephen Figgins explains. About the latter, Tim writes,

its primary goal really is to ensure that documentation examples work as advertised. That you can stuff a pretty general unit-testing facility on top of it with little pain wasn't a design goal, but a consequence of that it can interpret arbitrary Python code hiding in arbitrary strings.
[Explain how doctest is *really* easy to use.]

[Explain alternate testing frameworks, test package, and PyDoc philosophy.]

In principle, doctest has a home at the Python Language Website. For times when that's not available, I've provided mirrors for the README and implementing Python source.

Peter Funk compares Quixote and doctest.

See also "Python Documentation Tips and Tricks" and "Using pydoc".


Cameron Laird's personal notes on Python testing/claird@phaseit.net