doctest, unittest, or if __name__='__main__'

Max M maxm at mxm.dk
Wed Mar 22 02:56:06 EST 2006


john_sips_tea at yahoo.com 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?


Exactly.


 >>> '\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

http://www.mxm.dk/
IT's Mad Science

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



More information about the Python-list mailing list