[Zope-CMF] Re: Tools as local utilities
jens at dataflake.org
Fri Feb 2 13:41:43 EST 2007
-----BEGIN PGP SIGNED MESSAGE-----
On 24 Jan 2007, at 12:58, yuppie wrote:
> The logging messages no longer show up and I simplified the
> FunctionalLayer tests. No need to register the tools again - setSite
> (self.app.site) sets up the correct registry.
> But the cleanup issues are still not resolved. AFAICS the problem
> is caused by the new registerUtility() calls that pollute the
> global registry.
> Inside layers we can't use cleanUp() because it would destroy the
> layer setup. I'm afraid each test needs an explicit
> unregisterUtility() for each registered tool.
> Or maybe we should perform a complete set up / tear down for each
> unit test, not just for the layer. This way we can always use
> cleanUp(). That might not be too expensive for non-functional tests.
> Functional tests don't have the same problem because there is no
> need to mess around with the global registry.
I'm going to spend some time this weekend adding unregisterUtility
where needed. Thanks for your help!
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)
-----END PGP SIGNATURE-----
More information about the Zope-CMF