[Checkins] SVN: zope.testing/branches/stub-testSetUp_in_layer/src/zope/testing/testrunner Doctests demonstrating layers from a users point of view, including tests of the proposed layer.testSetUp and layer.testTearDown feature soon to be implemented.

Benji York benji at zope.com
Fri Jun 16 09:07:59 EDT 2006


Stuart Bishop wrote:
> Log message for revision 68686:
>   Doctests demonstrating layers from a users point of view, including tests of the proposed layer.testSetUp and layer.testTearDown feature soon to be implemented.

Another option, instead of the classes with all the classmethods would 
be to create singleton instances of the layer classes and use those.

> +>>> class TopLayer(BaseLayer):
> +...     @classmethod
> +...     def setUp(cls):
> +...         log('TopLayer.setUp')
> +...
> +...     @classmethod
> +...     def tearDown(cls):
> +...         log('TopLayer.tearDown')
> +...
> +...     @classmethod
> +...     def testSetUp(cls):
> +...         log('TopLayer.testSetUp')
> +...
> +...     def testTearDown(cls):
> +...         log('TopLayer.testTearDown')

I think you forgot an @classmethod above.

Oh, and it'd be nice if you wrapped your commit messages :)
-- 
Benji York
Senior Software Engineer
Zope Corporation


More information about the Checkins mailing list