annoying doctest problem

Ned Batchelder ned at nedbatchelder.com
Mon Jan 12 10:47:25 EST 2015


On 1/11/15 11:20 PM, gordianknot1981 at gmail.com wrote:
>
> It failed with an unknown reason that evaluate two expected equal value but got an unexpected result! I'm struggling with this problem for a long time. Did I did something wrong? And how do I to fix it?
>
> any help is appreciated. :)
>

My recommendation is to use doctest to test the code samples that 
naturally occur in your docstrings, but not to use it as a 
general-purpose testing tool.  It has too many limitations and quirks, 
and if you're going to write separate test methods anyway, why not just 
write actual code?

More detail here: 
http://nedbatchelder.com/blog/200811/things_i_dont_like_about_doctest.html


-- 
Ned Batchelder, http://nedbatchelder.com




More information about the Python-list mailing list