As an alternative to doctest, I wrote mkcodes , a script that pulls blocks of code from markdown files so that they can be tested in a separate file.
Here is my actual test script using mkcodes:
mkcodes --github --output tests/docs/test_{name}.py docs
py.test tests
pyflakes tests
pep8 tests
source
share