[Zope-CMF] Will the real test please step forward?

Hanno Schlichting hanno at hannosch.eu
Fri Jun 25 14:44:02 EDT 2010


On Fri, Jun 25, 2010 at 8:30 PM, Charlie Clark
<charlie.clark at clark-consulting.eu> wrote:
> What are the guidelines on docstrings in unit tests? I'm finding it
> helpful to write some kind of narrative which says what parameters are
> being twiddled and what I expect as a result. Doesn't stop the contortions
> with the method names but might help otherwise.

We generally don't use docstrings in test methods. These will show up
in the test output instead of the test method name and thus make it
harder to find a failing test.

Normal inline comments are perfectly fine and should be used it the
tests intent isn't clear from the code. Most often the test code
should be sufficient to explain itself or require some refactoring.

Hanno


More information about the Zope-CMF mailing list