I just read "Unit testing" chapter of the excellent "Dive into Python" book. I know that Zope 3 development extensively use unit testing development. I wonder if anynone use unit testing for Zope 2.* product development? Any insights or advices?
I always do it (for zope or non zope stuffs). The problem is it's difficult to pass classes that use Zope features through the unittests without knowing in depth the Zope machinery. So I make as much as possible "blind" python ressources (classes, functions), in distinct modules, that can be used outside of Zope framework, then I make the Zope layer. --Gilles ----- Original Message ----- From: "Jean-François Ménard" <menard.jean-francois@hydro.qc.ca> To: <zope@zope.org> Sent: Monday, May 27, 2002 3:35 PM Subject: [Zope] Unit testing
I just read "Unit testing" chapter of the excellent "Dive into Python" book. I know that Zope 3 development extensively use unit testing development.
I wonder if anynone use unit testing for Zope 2.* product development?
Any insights or advices?
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
participants (3)
-
Gilles Lenfant -
Jean-François Ménard -
Simon Michael