[Python-Dev] Purpose of Doctests [Was: Best practices for Enum]

Mark Janssen dreamingforward at gmail.com
Tue May 21 03:55:15 CEST 2013


>> * Doctests practically beg you to write your code first and then copy and
>> paste terminal sessions - they're the enemy of TDD
>
> Of course , not , all the opposite . If the approach is understood
> correctly then the first thing test author will do is to write the
> code «expected» to get something done . When everything is ok with API
> code style then write the code . Many problems in the API and
> inconsistencies are thus detected early .

Now all we need is a test() built-in, a companion to help() and we
have the primo platform for doctest-code-test cycle for TDD and agile
development.

--Mark


More information about the Python-Dev mailing list