doctest, unittest, or if __name__='__main__'

Max M maxm at
Wed Mar 22 08:56:06 CET 2006

john_sips_tea at wrote:
>>and you can kill two birds with one stone.
> By that, do you mean you can write your tests and your
> docstrings in one shot with doctest?


 >>> '\n'.join(['Doctests are absolutely brilliant!'] * 100)

They combine two brilliant ideas that are hard to do in practice. 
"Testing" and "Literate Programming"

In the process it even manages to make both a lot easier.


hilsen/regards Max M, Denmark
IT's Mad Science

Phone:  +45 66 11 84 94
Mobile: +45 29 93 42 96

More information about the Python-list mailing list