Martin Aspeli wrote:

Layers are ... layered. If your test base class has layer X and a test case
subclass of that has layer Y, then it will set up X, run all the X tests,
then setup Y and run all the Y and X&Y tests, then tear down Y and then X.

I didn't mention subclassing tests. Personally, I think that's evil...

I did this in Plone recently, but it completely escapes me where. Maybe I'll
have an epiphany after lunch, but look at how the ZCML layer in
PloneTestCase trunk works (it sets up all kinds of ZCML) and then try to
derive a class from PloneTestCase (or your equivalent) and set layer =

What layer(s) would the following test be executed in:

class BaseX(TestCase):

   layer = 'X'

class BaseY(TestCase):

   layer = 'Y'

class SomeTests(BaseX,BaseY):

   def test_1(self):



Simplistix - Content Management, Zope & Python Consulting
Zope3-dev mailing list

Reply via email to