Re: [Zope3-dev] layers can't be new style classes?

2006-10-17 Thread Stefan H. Holek
IIRC you need @classmethod def setUp(cls): pass @classmethod def tearDown(cls): pass On 17. Okt 2006, at 12:30, Chris Withers wrote: It would appear that Philipp's article is somewhat misleading in that layers can't be new style classes... class

Re: [Zope3-dev] layers can't be new style classes?

2006-10-17 Thread Chris Withers
Stefan H. Holek wrote: IIRC you need @classmethod def setUp(cls): pass @classmethod def tearDown(cls): pass Sorry, braino on my part. Yes, I have the @classmethod's and I still see the error: AttributeError: type object 'object' has no attribute 'setUp'

Re: [Zope3-dev] layers can't be new style classes?

2006-10-17 Thread Jim Fulton
Chris Withers wrote: Hi All, It would appear that Philipp's article is somewhat misleading in that layers can't be new style classes... class MyLayer(object): def setUp(self): pass def tearDown(self): pass ..results in the following when used as a layer: AttributeError: type object

Re: [Zope3-dev] layers can't be new style classes?

2006-10-17 Thread Chris Withers
Jim Fulton wrote: A layer is simply an object that has __module__, __name__, and __bases__ attributes and that has setUp and tearDown methods. That's it. You can achieve that any way you want. I regret the use of the __bases__ attribute. It would have been better if I had left it up to layer

Re: [Zope3-dev] layers can't be new style classes?

2006-10-17 Thread Jim Fulton
Jim Fulton wrote: Chris Withers wrote: Hi All, It would appear that Philipp's article is somewhat misleading in that layers can't be new style classes... class MyLayer(object): def setUp(self): pass def tearDown(self): pass ..results in the following when used as a layer:

Re: [Zope3-dev] layers can't be new style classes?

2006-10-17 Thread Chris Withers
Jim Fulton wrote: I may have spoken too soon. It looks like there is code to handle the object-as-base case in the test runner, at least on the trunk. Perhaps the version used by zope3 doesn't handle this case, or perhaps there's a bug that needs to be pursued. That'd explain it, I'm using

Re: [Zope3-dev] layers can't be new style classes?

2006-10-17 Thread Paul Winkler
On Tue, Oct 17, 2006 at 11:30:46AM +0100, Chris Withers wrote: Hi All, It would appear that Philipp's article is somewhat misleading in that layers can't be new style classes... class MyLayer(object): def setUp(self): pass def tearDown(self): pass ..results in the following

Re: [Zope3-dev] layers can't be new style classes?

2006-10-17 Thread Chris Withers
Paul Winkler wrote: Is this a bug in Philipp's article or in the testrunner? I noticed the same thing when I wrote my zopewiki page (http://zopewiki.org/TestLayersHowTo) but it looks like new-style classes should work now, judging by this svn log message: r68925 | Zen | 2006-06-30 07:49:37