[Zope-CMF] Re: Zope 3 events from workflow

Tres Seaver tseaver at palladion.com
Wed Dec 27 10:16:57 EST 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Rocky Burt wrote:
> On Wed, 2006-27-12 at 11:46 +0100, Jens Vagelpohl wrote:
>> P.S.: I _hate hate hate_ doctests ;)
> 
> Why?

I won't speak for Jens, but I find they have two serious drawbacks when
used as *unit tests* (as opposted to quasi-functional tests with narrative):

  - Tests dont run in isolation from one another (this is why I say
    quasi-functional).

  - The contortions required to get testable output printed often
    obscure the intent of the test itself.

I prefer a unit test module with many tests, each *exteremely short*,
with each test covering exactly *one* of the permutations of the state
which triggers the behavior-under-tset.  The name of the test case
method can then serve to document the intent.

I try to keep those tests short by factoring "setup" code out into
helper methods.



Tres.
- --
===================================================================
Tres Seaver          +1 540-429-0999          tseaver at palladion.com
Palladion Software   "Excellence by Design"    http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFko5p+gerLs4ltQ4RAnk5AKCRXF2TvZzhb+NtVQYAck2SPrbHoACgnMss
PNAd3LQ6sCey3CRTaV+2zZM=
=FO6M
-----END PGP SIGNATURE-----



More information about the Zope-CMF mailing list