[Python-3000] doctests vs. unittests (was Re: pimp; restructuring the standard library)

Phillip J. Eby pje at telecommunity.com
Thu Jun 28 22:57:04 CEST 2007


At 04:04 PM 6/28/2007 -0400, Chris McDonough wrote:
>a) If one of your fixture calls or an assertion fails for some
>reason, the rest of the test
>     trips over itself trying to complete, usually without success
>because an invariant
>     hasn't been met, and you need to scroll through a bunch of decoy
>output to
>     see where the actual problem began.

Use the REPORT_ONLY_FIRST_FAILURE option:

http://python.org/doc/2.4.1/lib/doctest-options.html


>b) I often use test bodies as convenient points to put a
>pdb.set_trace call if I want to
>     debug something.  This wasn't very well supported when I was
>trying to use doctest.

I believe this was fixed in 2.4.  And I *know* it's fixed in 2.5.  :)



More information about the Python-3000 mailing list