[wingide-users] Plone unit tests in WinG

Martijn Pieters mj at zopatista.com
Thu Feb 16 16:35:51 EST 2006

Danny Bloemendaal wrote:
> Can somebody please tell me how I can run and debug plone/zope unit  
> tests in Wing?
> I have made a plone product and put that in my products folder with a  
> tests subfolder in there. The tests run from the command line but for  
> some reason I can't get it to work in Wing.

I generally try and avoid the 'unit tests' framework of Plone (they are 
integration tests, mostly). For actual unit tests that require Products 
imports to work (most Zope Product tests) I use the following code at 
the top of such test module:

   import unittest
   import Testing
   import Zope2

Together with the usual unittest.main call this will ensure that the 
tests can be run from the command-line if PYTHONPATH and INSTANCE_HOME 
are defined. So all that remains to run such tests in Wing is ensuring 
that you define these environment variables in your project or on the 
environment tab of the debug dialog.

For my current project for example my environment variables are defined 
as follows:


The first points to a Zope software home, the second to the zope instance.

Perhaps this setup will also work for Plone testcases.

Martijn Pieters
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 256 bytes
Desc: OpenPGP digital signature
Url : /pipermail/wingide-users/attachments/20060216/7c264fed/signature.bin

More information about the wingide-users mailing list