On 04/20/2010 08:44 PM, Jim Fulton wrote:
On Tue, Apr 20, 2010 at 12:09 PM, Christian Theune<c...@gocept.com>  wrote:
Minor note: zope.testing *promotes* layers the wrong way and
zope.app.testing definitely implements them the wrong way.

That's prety vague. Could you say specifically in what ways
zope.testing promotes layers the wrong way and

zope.testing uses the attribute '__bases__' to store the information what the base layers are. __*__ are supposedly Python internal attributes. Specifically __bases__ is known to be used to store information which base classes a class has.

Looking at this I (and others too) get directed towards: aha, so layers are classes and use inheritance to signal what base layers are. Which is exactly not what is happening.

 > zope.app.testing uses them the wrong way?

Actually it doesn't. I confused this with Zope 2's Testing:

There's Testing/ZopeTestCase/layer.py which defines a class with classmethods and in a similar fashion there is Products.PloneTestCase that defines classes, derives them and thus kind of piggybacks on the class inheritance mechanism to establish __bases__ paired with static methods but without actually inheriting methods.

We struggled through some hairy details that I fail to remember when we worked on gocept.selenium last year which tries to establish a generic layer that can be combined with others. Looking at the layer code in gocept.selenium right now it feels relatively clean, although the exact choice of attribute names IMHO is confusing for anyone trying to understand whats going on and why.


Christian Theune · c...@gocept.com
gocept gmbh & co. kg · forsterstraße 29 · 06112 halle (saale) · germany
http://gocept.com · tel +49 345 1229889 0 · fax +49 345 1229889 1
Zope and Plone consulting and development

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Zope-Dev maillist  -  Zope-Dev@zope.org
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope )

Reply via email to