DocTest

A hybrid of HERE docs and literate programming, Doctest is a standard library feature of Python that uses the interactive shell to run tests. Ian Bicking has a JavaScript version that runs in FireFox.