[Zope3-dev] Individual packages and functional testing

Jim Fulton jim at zope.com
Fri Oct 27 10:18:44 EDT 2006


Baiju M wrote:
> Hi,
>    As part of eggification [1], I was creating an egg of zope.testbrowser
> There are some functional tests in that package.  So, I have to copy few
> ZCML files to top directory from an instance to run the functional tests.

No you don't and shouldn't.

> How do we handle the functional tests for individual packages?

Each package *should* define it's own functional test layer using
zope.app.testing.functional.ZCMLLayer or
zope.app.testing.functional.defineLayer.  This will require each package to
define a minimal ZCML file that includes just enough to be able to use
the package.

> Should I add all ZCML files to each packages which required functional 
> testing?

No.

> I think I am missing something here, because Zope 3 main test.py works
> without these
> ZCML files?

I'm not sure what else you're doing, but the Zope 3 instance recipe
can add ZCML slugs to package-includes.  This will allow older packages
that use the default functional testing layer to work as they do now.

> I have committed zope.testbrowser [2], to enable functional tests,
> change test-pattern in test.py to '^f?tests$'.

BTW, I'd like to phase out the use of ftests files.  The older testrunner
used file names to decide whether to run tests as unit tests or functional
tests. The current testrunner uses layers so we don't need a different file name
any more.

Jim

-- 
Jim Fulton           mailto:jim at zope.com       Python Powered!
CTO                  (540) 361-1714            http://www.python.org
Zope Corporation     http://www.zope.com       http://www.zope.org


More information about the Zope3-dev mailing list