[Checkins] SVN: z3c.testsetup/branches/ulif-cleanup/src/z3c/testsetup/tests/layered_cave/ Split plain unittest layers and functional layers.
Uli Fouquet
uli at gnufix.de
Mon Oct 26 09:10:00 EDT 2009
Log message for revision 105276:
Split plain unittest layers and functional layers.
Changed:
A z3c.testsetup/branches/ulif-cleanup/src/z3c/testsetup/tests/layered_cave/flayer.py
U z3c.testsetup/branches/ulif-cleanup/src/z3c/testsetup/tests/layered_cave/layer.py
-=-
Added: z3c.testsetup/branches/ulif-cleanup/src/z3c/testsetup/tests/layered_cave/flayer.py
===================================================================
--- z3c.testsetup/branches/ulif-cleanup/src/z3c/testsetup/tests/layered_cave/flayer.py (rev 0)
+++ z3c.testsetup/branches/ulif-cleanup/src/z3c/testsetup/tests/layered_cave/flayer.py 2009-10-26 13:10:00 UTC (rev 105276)
@@ -0,0 +1,27 @@
+"""Functional layer definitions.
+
+This could also be done in the setup file itself.
+"""
+import os
+import zope.app.testing
+from zope.app.testing.functional import ZCMLLayer
+
+# We define a ZCML test layer. ZCML layers are special as they define
+# some setup code for creation of empty ZODBs and more. If you only
+# want some ZCML registrations to be done, you can use it like so:
+FunctionalLayer1 = ZCMLLayer(
+ # As first argument we need the absolute path of a ZCML file
+ os.path.join(os.path.dirname(zope.app.testing.functional.__file__),
+ 'ftesting.zcml'),
+
+ # Second argument is the module, where the layer is defined.
+ __name__,
+
+ # This is the name of our layer. It can be an arbitrary string.
+ 'FunctionalLayer1',
+
+ # By default ZCML layers are not torn down. You should make sure,
+ # that any registrations you do in your ZCML are removed in a
+ # tearDown method if you specify this parameter to be `True`. This
+ # parameter is optional.
+ allow_teardown = True)
Modified: z3c.testsetup/branches/ulif-cleanup/src/z3c/testsetup/tests/layered_cave/layer.py
===================================================================
--- z3c.testsetup/branches/ulif-cleanup/src/z3c/testsetup/tests/layered_cave/layer.py 2009-10-26 12:52:34 UTC (rev 105275)
+++ z3c.testsetup/branches/ulif-cleanup/src/z3c/testsetup/tests/layered_cave/layer.py 2009-10-26 13:10:00 UTC (rev 105276)
@@ -1,32 +1,8 @@
-"""Layer definitions.
+"""Unittest layer definitions.
This could also be done in the setup file itself.
"""
-import os
-import zope.app.testing
-from zope.app.testing.functional import ZCMLLayer
-
-# We define a ZCML test layer. ZCML layers are special as they define
-# some setup code for creation of empty ZODBs and more. If you only
-# want some ZCML registrations to be done, you can use it like so:
-FunctionalLayer1 = ZCMLLayer(
- # As first argument we need the absolute path of a ZCML file
- os.path.join(os.path.dirname(zope.app.testing.functional.__file__),
- 'ftesting.zcml'),
-
- # Second argument is the module, where the layer is defined.
- __name__,
-
- # This is the name of our layer. It can be an arbitrary string.
- 'FunctionalLayer1',
-
- # By default ZCML layers are not torn down. You should make sure,
- # that any registrations you do in your ZCML are removed in a
- # tearDown method if you specify this parameter to be `True`. This
- # parameter is optional.
- allow_teardown = True)
-
class UnitLayer1(object):
"""This represents a layer.
A layer is a way to have common setup and teardown that happens
More information about the checkins
mailing list