[Zope] Re: Unit testing

Simon Michael simon@joyful.com
Mon, 27 May 2002 13:01:10 -0700


I have tried a few different approaches in the ZWiki product.  I found it
hard going, partly because my tests tried to do too much, but also because
much of zope2's functionality will not work in isolation so it's not very
testable. However things are going reasonably well for the moment -

- I run tests at the command line; they don't require a real ZODB (no
  import Zope)

- I'm using mock objects (http://zwiki.org/zwikidir/tests/support.py,
http://mockobjects.com)

- I run tests against zope 2.5 using testrunner.py and against 2.3 by
running each test file (http://zwiki.org/zwikidir/Makefile -> rtest rules)

- I can write either pyunit or doctest-style tests
  (http://zwiki.org/zwikidir/tests/testDoctests.py)

Hope this helps,
-Simon