[TIP] The war of flavours reloaded doctest vs unittest ... WAS: Test discovery for unittest

Olemis Lang olemis at gmail.com
Fri Apr 10 10:53:06 PDT 2009


On Fri, Apr 10, 2009 at 12:32 PM, Michael Foord
<fuzzyman at voidspace.org.uk> wrote:
> Benji York wrote:
>> On Fri, Apr 10, 2009 at 12:28 PM, Michael Foord
>> <fuzzyman at voidspace.org.uk> wrote:
>>> Olemis Lang wrote:
>>>
>>>> I personally think that doctest is the most beautiful implementation
>>>> ever made for the following XUnit test patterns :
>>>>
>>>> - Deltha Assertion
>>>> - Scripted Test
>>>> - Recorded Test
>>>> - Data-Driven Test
>>>> - Behavior Verification
>>>> - State Verification
>>>>
>>>> and still allows being meta + agile
>>>
>>> Doctest is simply awful for Test Driven Development, the cornerstone of
>>> agile.
>>
>> I disagree.
>>
>> Thankfully you provided no support for your argument so I don't
>> have to either.  :)
>
> Doctest how I loathe thee:
> http://www.voidspace.org.uk/python/weblog/arch_d7_2008_10_25.shtml#e1022
>
> A list of reasons from my experiences of testing ConfigObj with doctest:
> http://www.voidspace.org.uk/python/weblog/arch_d7_2008_01_12.shtml#e920
>
> Why doctest makes poor unittests:
> http://andrew.puzzling.org/diary/2008/October/24/more-doctest-problems
>
> Minor comments from me (particularly missing assert methods):
> http://www.voidspace.org.uk/python/weblog/arch_d7_2008_10_25.shtml#e1023
>

I'll take a look at that later ... but in advance I've seen nothing
more agile than Greg's example for web testing using twill + doctest
(... even if I couldnt reproduce it, well I do trust'em ...

Besides with doctest I get many things at once:

- Documentation
- Example usage
- Mini-Tutorials
- Tests
- Fun  ...  :P

I have some ideas around. Let's see how much I'll can implement in the
next few days ...

;o)

-- 
Regards,

Olemis.

Blog ES: http://simelo-es.blogspot.com/
Blog EN: http://simelo-en.blogspot.com/

Featured article:
Se retira el BDFL ... ¿El fin de Python 3k?  -
http://feedproxy.google.com/~r/simelo-es/~3/HpncxTKfB1c/se-retira-el-bdfl-el-fin-de-python-3k_02.html



More information about the testing-in-python mailing list