Re: RFC: Proposal for merging jbohman-zope.registry branch of zope.component
Jim Fulton <[email protected]>
| Newsgroups | gmane.comp.web.zope.devel |
|---|---|
| Message-ID | <CAPDm-FikiV-9vs2OW-x-Cm1bjrPaDB96vDZ6Ob9quiXMxsaHzQ@mail.gmail.com> |
On Thu, Sep 1, 2011 at 1:28 PM, Chris McDonough <[email protected]> wrote: > On Thu, 2011-09-01 at 09:22 -0400, Jim Fulton wrote: >> On Thu, Sep 1, 2011 at 4:27 AM, Chris McDonough <[email protected]> wrote: >> ... >> > - zope.testing (for addCleanUp of the global registry in >> > z.c.globalregistry and other places) >> >> This particular detail should simply be cleaned up by >> moving these calls into tests module. > > This is in zope.component.globalregistry at module scope: > > base = BaseGlobalComponents('base') > > try: > from zope.testing.cleanup import addCleanUp > except ImportError: > pass > else: > addCleanUp(lambda: base.__init__('base')) > del addCleanUp > > I didn't see that the registration was conditional on the presence of > zope.testing last night, but if I understand the intent correctly, it's > to ensure that importing z.component at all will add a cleanup callback > to zope.testing such that z.testing.cleanUp() will wipe the global > registry state. Lots of existing tests will break if this isn't done, > so I'm not sure that moving it into a place where it isn't executed as a > side effect is feasible? I was thinking only of zope.component's tests. There's still the issue of tests of clients of zope.component, which my suggestion doesn't address. Jim -- Jim Fulton http://www.linkedin.com/in/jimfulton _______________________________________________ Zope-Dev maillist - [email protected] https://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope )