[Python-ideas] Fwd: doctest

Mark Janssen dreamingforward at gmail.com
Mon Feb 27 21:01:49 CET 2012

On Mon, Feb 27, 2012 at 12:58 PM, Ethan Furman <ethan at stoneleaf.us> wrote:
> Mark Janssen wrote:
>> Personally, I don't find unittest very suitable for test-driven
>> *development*, although it *is* obviously well-suited for writing
>> assurance tests otherwise.
> I like unittest for TDD.

I should probably correct myself.  It is suiltable, just not
enjoyable.  But now I know you are someone who likes all that arcana
of unittest module.

> unittest can be a bit bulky, but definitely worth it IMO, especially when
> covering the corner cases.

Corner cases are generally useful for the developer to know about, so
its worth it to mention (==> test) in the documentation.

> I have not used doctest, but I can say that I strongly dislike having more
> than one or two examples in a docstring.

This is often just a failure to separate tests property among different methods.

> The other gripe I have (possibly easily fixed): my python prompt is '-->'
> (makes email posting easier) -- should my doctests still use '>>>'?  Will
> doctest fail on my machine?

As written, yes, but easily changeable in the module code for your
unique case....


More information about the Python-ideas mailing list