Martin Aspeli wrote:
> Hi,
> 
> Something has changed in Zope 2.12 that is causing tests that use 
> PlacelessSetup's tearDown() with Five to fail:
> 
> Error in test 
> /Users/optilude/Development/Plone/Code/Build/plone/4.0/src/plone.autoform/plone/autoform/tests/../autoform.txt
> Traceback (most recent call last):
>    File 
> "/Users/optilude/.buildout/eggs/zope.testing-3.7.7-py2.6.egg/zope/testing/doctest.py",
>  
> line 2416, in debug
>      self.tearDown()
>    File 
> "/Users/optilude/.buildout/eggs/zope.testing-3.7.7-py2.6.egg/zope/testing/doctest.py",
>  
> line 2295, in tearDown
>      self._dt_tearDown(test)
>    File 
> "/Users/optilude/.buildout/eggs/zope.app.testing-3.6.2-py2.6.egg/zope/app/testing/placelesssetup.py",
>  
> line 59, in tearDown
>      tearDown_()
>    File 
> "/Users/optilude/.buildout/eggs/zope.testing-3.7.7-py2.6.egg/zope/testing/cleanup.py",
>  
> line 55, in cleanUp
>      cleanUp()
>    File 
> "/Users/optilude/.buildout/eggs/zope.testing-3.7.7-py2.6.egg/zope/testing/cleanup.py",
>  
> line 63, in cleanUp
>      func(*args, **kw)
>    File 
> "/Users/optilude/.buildout/eggs/Zope2-2.12.1-py2.6-macosx-10.6-i386.egg/Products/Five/fiveconfigure.py",
>  
> line 228, in cleanUp
>      Products.meta_types = tuple([ info for info in Products.meta_types
> AttributeError: 'module' object has no attribute 'meta_types'
> 
> 
> Sure enough, Products.meta_types is not set. In the Zope2 egg, 
> Products/__init__.py contains only the setuptools boilerplate for 
> namespace packages. I'm not sure how or where Products.meta_type is set 
> these days.
> 
> Does anyone know how to correctly fix this? We could make the tear-down 
> code in Five more robust, obviously, but I fear that's just hiding a 
> deeper problem?

I couldn't find a deeper problem, so I just added some safety to the 
cleanUp() method using getattr(). If anyone thinks this is a bad idea, 
let me know.

Martin

-- 
Author of `Professional Plone Development`, a book for developers who
want to work with Plone. See http://martinaspeli.net/plone-book

_______________________________________________
Zope-Dev maillist  -  Zope-Dev@zope.org
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 )

Reply via email to