[Zope3-dev] Re: [Zope-Checkins] CVS: Zope3/src/persistent/tests - test_persistent.py:1.5 persistent.txt:1.2

Jim Fulton jim at zope.com
Mon Mar 8 09:24:21 EST 2004


Chris Withers wrote:
> Jim Fulton wrote:
> 
>> doctest tests are text with Python examples.
> 
> 
> Yes, but that is not python.

The examples are.

> Feed the text of a doctest to python and I'm sure it will complain ;-)

No, Python handles the example just fine.

>> Yup. But out experience has been that it is much easier and thus
>> morel likely to write well-documented tests in doctest than with the
>> straight unittest framework.  For example, unitest makes it easier to
>> write python code than to write words. 
> 
> 
> What's wrong with docstrings in unit tests?

The docstrings aren't interspuursed with the code.

Bonus, the unittest uses docstrings, if present, in test reports,
which usually makes it hard to tell what test was being run. As a
result, we specifically ask people *not* to write doc strings for
test methods.

Jim

-- 
Jim Fulton           mailto:jim at zope.com       Python Powered!
CTO                  (540) 361-1714            http://www.python.org
Zope Corporation     http://www.zope.com       http://www.zope.org




More information about the Zope3-dev mailing list