[Zope-Coders] Testing from an INSTANCE_HOME

Shane Hathaway shane@ZOPE.COM
Fri, 06 Jun 2003 13:47:12 -0400


Chris Withers wrote:
> I've seen discussion on this recently so thought I'd chime in.
> It's has been impossible to run product tests from an INSTANCE_HOME 
> setup for some time now due to testrunner.py importing the Testing package.
> 
> That in itself isn't a bad thing, the bad thing is the __init__.py of 
> the Testing package stomping all over the SOFTWARE_HOME and 
> INTSANCE_HOME environment variables.

I think I just stumbled on the right solution for this.  It's so obvious 
that I guess I overlooked it!

What if we just decided that unit tests should not use Zope.app() to 
open a database, but rather a new function called Testing.app()? 
Testing.app() would return a clean database that unit tests are free to 
change.  If all unit tests that use Zope.app() start using Testing.app() 
instead, we won't need the custom_zodb.py hack and the Testing package 
can leave INSTANCE_HOME alone.

Does anyone see any holes in this plan?  It might even open up some 
opportunities to speed up test initialization.

Shane