[Zope-Coders] Re: [Zope-Checkins] CVS: Zope3/lib/python/Persistence/BTrees/tests - testBTrees.py:1.1.2.3 testBTreesUnicode.py:1.1.2.4

Chris Withers chrisw@nipltd.com
Sun, 02 Jun 2002 09:03:10 +0100


Guido van Rossum wrote:
> 
> > Guido van Rossum wrote:
> > >
> > > Tests shouldn't have docstrings.
> 
> [Chris W]
> 
> > unittest.py will print the docstrings in addition to the test name
> > if the test fails.

> But unittest prints the docstring *instead* of the test name when it
> succeeds.  

Hmm... that shouldn't be too hard to fix. Perhaps on -v 2 it should print the
test docstring on one line and then on the next line the fully qualified module
name?

-------------------------------------------------------------
Test that foo's don't bar when x <0
(Products.Foofactory.tests.foo)

> Sometimes in real life tests don't fail but hang, and then
> you have no easy way to find the test.  

Indeed.

> There's also the consistency
> argument: 99% of the Zope doctests don't have docstrings, but (most)
> have long meaningful descriptive names instead.

Is 100% consistency needed? It _is_ often easy to gaive a tests a sufficiently
meaningful name that no docstring is necessary. However, in some cases,
particularly with tricky bugs, I find a docstring is useful for explaining in a
bit more detail.

chers,

Chris