Exception inside loop wrongly failing doctest

Ben Finney ben+python at benfinney.id.au
Fri Jun 12 20:14:15 EDT 2009

Steven D'Aprano <steve at REMOVETHIS.cybersource.com.au> writes:

> Ah, that would be it. Not a bug then, a limitation of the doctest module. 

The doctest module is good for narrative tests (ensuring that examples
in documentation actually work as written), but poor for unit testing.
Both functions are useful, but each should use a different tool

Not entirely related to the limitation you've found, and I don't know
from your explanation whether you're mixing the two purposes, but it's
worth pointing out in case you are.

 \     “I used to think that the brain was the most wonderful organ in |
  `\   my body. Then I realized who was telling me this.” —Emo Philips |
_o__)                                                                  |
Ben Finney

More information about the Python-list mailing list