trying to remember how to do inline code "testing"

Alex Hunsley redlex at bluebottle.com
Wed Oct 24 06:49:08 EDT 2007


Diez B. Roggisch wrote:
> Alex Hunsley wrote:
> 
>> I can remember Python having a feature which allowed you to add some
>> simple tests to your code, something like adding console output to your
>> actual python script, like so:
>>
>>
>>  >>> 1+1
>> 2
>>  >>> 2*7
>> 14
>>
>>
>> ... then python would actually run these queries and check that the
>> expected results occurred.
>> I can't find the docs for this feauture anywhere, but I'm certain I
>> didn't imagine this one!
>> Can anyone give me a reference?
> 
> http://docs.python.org/lib/module-doctest.html
 >
 > Diez

Brilliant, thanks for that Diez!
Alex



More information about the Python-list mailing list