[Python-ideas] Fwd: doctest

Ben Finney ben+python at benfinney.id.au
Tue Feb 28 11:24:46 CET 2012

Steven D'Aprano <steve at pearwood.info> writes:

> On Mon, Feb 27, 2012 at 12:28:17PM -0700, Mark Janssen wrote:
> > Well, hopefully, I've convinced you a little that the limitations in
> > doctests over unittests are almost, if not entirely due, to the
> > incompleteness of the module.

I don't think ‘doctest’ is incomplete. It comprehensively covers the use
case for which it is designed.

The ‘unittest’ module is limited in usefulness at testing code examples
in documentation. That doesn't make it incomplete, either.

> > If the two items I mentioned were implemented I think it would be
> > far superior to unittest.
> I already think that doctest is far superior to unittest, for testing
> executable examples in documentation. I don't think it is superior to
> unittest for unit testing, or regression testing. Nor is it inferior
> -- its just different.

+1 QotW.

 \        “The fact of your own existence is the most astonishing fact |
  `\    you'll ever have to confront. Don't dare ever see your life as |
_o__)    boring, monotonous, or joyless.” —Richard Dawkins, 2010-03-10 |
Ben Finney

More information about the Python-ideas mailing list