[TIP] ANNOUNCE: testdoc 0.1 - generate documents from unit tests
Jonathan Lange
jml at mumak.net
Sat Apr 21 18:22:10 PDT 2007
testdoc is a simple utility to turn Python unit tests into
human-readable documentation. testdoc scans a testing module, finds
all of the tests, converts class and method names into phrases and
inserts the docstrings as paragraphs.
http://launchpad.net/testdoc
With the right sort of habits, this lets you quickly turn your
executable descriptions of behaviour into readable descriptions of
behaviour.
Writing your tests with testdoc output in mind can lead to the
emphasis on thoughtful communication that makes doctests so helpful.
At the same time, you get to write your tests in an environment that
is optimized for writing Python code, with all the benefits of
fixtures and easy refactoring that going along with it.
Example: This Python source file:
http://twistedmatrix.com/trac/browser/trunk/twisted/conch/test/test_userauth.py
maps to this document:
http://mumak.net/stuff/ssh_userauth.txt
testdoc is based on ideas found in AgileDox[1], a Java project.
cheers,
jml
[1] http://opensource.thoughtworks.com/projects/agiledox.html
More information about the testing-in-python
mailing list