[TIP] Best way to do setup/teardown on a per-test basis using doctest?
Benji York
benji at benjiyork.com
Mon Jul 2 05:58:17 PDT 2007
Michael Foord wrote:
> Whilst I'm sure what you want can be done with doctest, it seems to
> offer little advantage in the general case other than forcing your tests
> to be inside strings
I really don't like doctests in docstrings, thankfully nearly all of the
(hundreds of) doctests in the code bases I work with are in text files.
As for the advantages of doctests, I won't repeat comments that are (I
believe) in the archives.
> and use lots of angle brackets!
I don't understand that remark.
> I realise there are those on this list that prefer doctest, but I
> disagree. Doctest is great for embedding executable examples into
> documentation, but not so well suited for large test suites. :-)
Why is that?
--
Benji York
http://benjiyork.com
More information about the testing-in-python
mailing list