[Checkins] SVN: z3c.testsetup/trunk/ Reverted allow_teardown default back to False to prevent confusion.
Reinout van Rees
reinout at vanrees.org
Wed Oct 21 19:29:31 EDT 2009
Log message for revision 105205:
Reverted allow_teardown default back to False to prevent confusion.
Changed:
U z3c.testsetup/trunk/CHANGES.txt
U z3c.testsetup/trunk/src/z3c/testsetup/README.txt
U z3c.testsetup/trunk/src/z3c/testsetup/doctesting.py
U z3c.testsetup/trunk/src/z3c/testsetup/functional/doctesting.py
U z3c.testsetup/trunk/src/z3c/testsetup/testrunner.txt
-=-
Modified: z3c.testsetup/trunk/CHANGES.txt
===================================================================
--- z3c.testsetup/trunk/CHANGES.txt 2009-10-21 16:40:20 UTC (rev 105204)
+++ z3c.testsetup/trunk/CHANGES.txt 2009-10-21 23:29:31 UTC (rev 105205)
@@ -4,6 +4,8 @@
0.6 (unreleased)
================
+* Reverted allow_teardown default back to False to prevent confusion.
+
0.5 (2009-09-23)
================
Modified: z3c.testsetup/trunk/src/z3c/testsetup/README.txt
===================================================================
--- z3c.testsetup/trunk/src/z3c/testsetup/README.txt 2009-10-21 16:40:20 UTC (rev 105204)
+++ z3c.testsetup/trunk/src/z3c/testsetup/README.txt 2009-10-21 23:29:31 UTC (rev 105205)
@@ -108,35 +108,38 @@
>>> from z3c.testsetup import testrunner
>>> testrunner.run(defaults)
Running z3c...layer.DefaultZCMLLayer [...ftesting.zcml] tests:
- Set up z3c...DefaultZCMLLayer [...ftesting.zcml] in N.NNN seconds.
- Ran 3 tests with 0 failures and 0 errors in N.NNN seconds.
+ Set up z3c...layer.DefaultZCMLLayer [...ftesting.zcml] in 2.146 seconds.
+ Ran 3 tests with 0 failures and 0 errors in 0.009 seconds.
Running z3c...layer.DefaultZCMLLayer [...ftesting2.zcml] tests:
- Tear down z3c...DefaultZCMLLayer [...ftesting.zcml] in N.NNN seconds.
- Set up z3c...DefaultZCMLLayer [...ftesting2.zcml] in N.NNN seconds.
- Ran 1 tests with 0 failures and 0 errors in N.NNN seconds.
+ Tear down z3c...layer.DefaultZCMLLayer [...ftesting.zcml] ... not supported
+ Running in a subprocess.
+ Set up z3c...layer.DefaultZCMLLayer [...ftesting2.zcml] in 0.040 seconds.
+ Ran 1 tests with 0 failures and 0 errors in 0.011 seconds.
+ Tear down z3c...layer.DefaultZCMLLayer [...ftesting2.zcml] ... not supported
Running z3c.testsetup.tests.othercave.testing.FunctionalLayer1 tests:
- Tear down z3c...DefaultZCMLLayer [...ftesting2.zcml] in N.NNN seconds.
- Set up z3c...tests.othercave.testing.FunctionalLayer1 in N.NNN seconds.
- Ran 1 tests with 0 failures and 0 errors in N.NNN seconds.
+ Running in a subprocess.
+ Set up z3c.testsetup.tests.othercave.testing.FunctionalLayer1 in 1.797 seconds.
+ Ran 1 tests with 0 failures and 0 errors in 0.013 seconds.
+ Tear down z3c.testsetup.tests.othercave.testing.FunctionalLayer1 in 0.001 seconds.
Running z3c.testsetup.tests.othercave.testing.UnitLayer2 tests:
- Tear down z3c...tests.othercave.testing.FunctionalLayer1 in N.NNN seconds.
- Set up z3c.testsetup.tests.othercave.testing.UnitLayer1 in N.NNN seconds.
- Set up z3c.testsetup.tests.othercave.testing.UnitLayer2 in N.NNN seconds.
+ Running in a subprocess.
+ Set up z3c.testsetup.tests.othercave.testing.UnitLayer1 in 0.000 seconds.
+ Set up z3c.testsetup.tests.othercave.testing.UnitLayer2 in 0.000 seconds.
Running testSetUp of UnitLayer1
Running testSetUp of UnitLayer2
Running testTearDown of UnitLayer2
Running testTearDown of UnitLayer1
- Ran 1 tests with 0 failures and 0 errors in N.NNN seconds.
+ Ran 1 tests with 0 failures and 0 errors in 0.009 seconds.
+ Tear down z3c.testsetup.tests.othercave.testing.UnitLayer2 in 0.000 seconds.
+ Tear down z3c.testsetup.tests.othercave.testing.UnitLayer1 in 0.000 seconds.
Running zope.testing.testrunner.layer.UnitTests tests:
- Tear down z3c...tests.othercave.testing.UnitLayer2 in N.NNN seconds.
- Tear down z3c...tests.othercave.testing.UnitLayer1 in N.NNN seconds.
- Set up zope.testing.testrunner.layer.UnitTests in N.NNN seconds.
- Custom setUp for <DocTest doctest05.txt from ... (2 examples)>
- Custom tearDown for <DocTest doctest05.txt from ... (2 examples)>
- Ran 7 tests with 0 failures and 0 errors in N.NNN seconds.
- Tearing down left over layers:
- Tear down zope.testing.testrunner.layer.UnitTests in N.NNN seconds.
- Total: 13 tests, 0 failures, 0 errors in N.NNN seconds.
+ Running in a subprocess.
+ Set up zope.testing.testrunner.layer.UnitTests in 0.000 seconds.
+ Custom setUp for <DocTest doctest05.txt from ...doctest05.txt:0 (2 examples)>
+ Custom tearDown for <DocTest doctest05.txt from ...doctest05.txt:0 (2 examples)>
+ Ran 7 tests with 0 failures and 0 errors in 0.011 seconds.
+ Tear down zope.testing.testrunner.layer.UnitTests in 0.000 seconds.
+ Total: 13 tests, 0 failures, 0 errors in 11.798 seconds.
False
As we can see, there were regular unittests as well as functional tests
@@ -397,9 +400,8 @@
The drawback is that profiling and coverage tools cannot combine the
profile/coverage data from separate processes. z3c.testsetup has a
- default of True (since 0.5), which gives you correct coverage/profiling
- output. If you do one of the rare things that can trip up a regular
- teardown of the zope component architecture, you'll have to set
+ default of False (since 0.5.1, True in 0.5). If you want correct
+ coverage/profiling output and your tests allow it, you'll have to set
``allow_teardown=False`` in your ``register_all_tests()`` call.
Modified: z3c.testsetup/trunk/src/z3c/testsetup/doctesting.py
===================================================================
--- z3c.testsetup/trunk/src/z3c/testsetup/doctesting.py 2009-10-21 16:40:20 UTC (rev 105204)
+++ z3c.testsetup/trunk/src/z3c/testsetup/doctesting.py 2009-10-21 23:29:31 UTC (rev 105205)
@@ -33,10 +33,10 @@
encoding = 'utf-8'
checker = None
-
+
def __init__(self, package, setup=None, teardown=None, globs=None,
optionflags=None, encoding=None, checker=None,
- allow_teardown=True, **kw):
+ allow_teardown=False, **kw):
BasicTestSetup.__init__(self, package, **kw)
self.setUp = setup or self.setUp
self.tearDown = teardown or self.tearDown
Modified: z3c.testsetup/trunk/src/z3c/testsetup/functional/doctesting.py
===================================================================
--- z3c.testsetup/trunk/src/z3c/testsetup/functional/doctesting.py 2009-10-21 16:40:20 UTC (rev 105204)
+++ z3c.testsetup/trunk/src/z3c/testsetup/functional/doctesting.py 2009-10-21 23:29:31 UTC (rev 105205)
@@ -56,7 +56,7 @@
def __init__(self, package, checker=None, zcml_config = None,
layer_name='FunctionalLayer', layer=None,
- allow_teardown=True, **kw):
+ allow_teardown=False, **kw):
DocTestSetup.__init__(self, package, **kw)
self.allow_teardown = allow_teardown
self.checker = checker
Modified: z3c.testsetup/trunk/src/z3c/testsetup/testrunner.txt
===================================================================
--- z3c.testsetup/trunk/src/z3c/testsetup/testrunner.txt 2009-10-21 16:40:20 UTC (rev 105204)
+++ z3c.testsetup/trunk/src/z3c/testsetup/testrunner.txt 2009-10-21 23:29:31 UTC (rev 105205)
@@ -186,19 +186,18 @@
Set up z3c.testsetup.tests.cave.SampleLayer in N.NNN seconds.
Ran 2 tests with 0 failures and 0 errors in N.NNN seconds.
Running zope.testing.testrunner.layer.UnitTests tests:
- Tear down z3c.testsetup.tests.cave.SampleLayer ...
+ Tear down z3c.testsetup.tests.cave.SampleLayer ... not supported
+ Running in a subprocess.
Set up zope.testing.testrunner.layer.UnitTests in N.NNN seconds.
Ran 2 tests with 0 failures and 0 errors in N.NNN seconds.
- Tearing down left over layers:
Tear down zope.testing.testrunner.layer.UnitTests in N.NNN seconds.
Total: 4 tests, 0 failures, 0 errors in N.NNN seconds.
False
Apparently now the custom ZCML file in the ``cave`` package was used.
-We can add an allow_teardown=False option, this prevents the test mechanism
-from tearing down the functional layers, they're run in a separate process
-instead:
+We can add an allow_teardown=True option, this allows the test mechanism
+to tear down the functional layers:
>>> setupfile = os.path.join(cavepath, 'samplesetup_teardown.py')
>>> print open(setupfile).read()
@@ -600,29 +599,30 @@
... '--tests-pattern', '^layeredsetup01$',
... ]
>>> testrunner.run(defaults)
- Running z3c...DefaultZCMLLayer [/.../bar/ftesting.zcml] tests:
- Set up z3c...DefaultZCMLLayer [/.../bar/ftesting.zcml] in N.NNN seconds.
- Ran 1 tests with 0 failures and 0 errors in N.NNN seconds.
- Running z3c...DefaultZCMLLayer [/.../foo/ftesting.zcml] tests:
- Tear down z3c...efaultZCMLLayer [/.../bar/ftesting.zcml] ...
- Set up z3c...efaultZCMLLayer [/.../foo/ftesting.zcml] in N.NNN seconds.
- Ran 1 tests with 0 failures and 0 errors in N.NNN seconds.
- Running z3c.testsetup.tests.layered_cave.layer.FunctionalLayer1 tests:
- Tear down z3c...efaultZCMLLayer [/.../foo/ftesting.zcml] ...
- Set up z3c...layered_cave.layer.FunctionalLayer1 in N.NNN seconds.
- Ran 1 tests with 0 failures and 0 errors in N.NNN seconds.
- Running z3c.testsetup.tests.layered_cave.layer.UnitLayer1 tests:
- Tear down z3c...layered_cave.layer.FunctionalLayer1 in N.NNN seconds.
- Set up z3c.testsetup.tests.layered_cave.layer.UnitLayer1 in N.NNN seconds.
+ Running z3c....DefaultZCMLLayer [.../bar/ftesting.zcml] tests:
+ Set up z3c....DefaultZCMLLayer [.../bar/ftesting.zcml] in 0.027 seconds.
+ Ran 1 tests with 0 failures and 0 errors in 0.002 seconds.
+ Running z3c....DefaultZCMLLayer [.../foo/ftesting.zcml] tests:
+ Tear down z3c....DefaultZCMLLayer [.../bar/ftesting.zcml] ... not supported
+ Running in a subprocess.
+ Set up z3c....DefaultZCMLLayer [.../foo/ftesting.zcml] in 0.055 seconds.
+ Ran 1 tests with 0 failures and 0 errors in 0.015 seconds.
+ Tear down z3c....DefaultZCMLLayer [.../foo/ftesting.zcml] ... not supported
+ Running z3c....FunctionalLayer1 tests:
+ Running in a subprocess.
+ Set up z3c....FunctionalLayer1 in 0.040 seconds.
+ Ran 1 tests with 0 failures and 0 errors in 0.011 seconds.
+ Tear down z3c....FunctionalLayer1 in 0.000 seconds.
+ Running z3c....UnitLayer1 tests:
+ Running in a subprocess.
+ Set up z3c....UnitLayer1 in 0.000 seconds.
Running testSetUp of UnitLayer1
Running testTearDown of UnitLayer1
- Ran 1 tests with 0 failures and 0 errors in N.NNN seconds.
- Tearing down left over layers:
- Tear down z3c...layered_cave.layer.UnitLayer1 in N.NNN seconds.
- Total: 4 tests, 0 failures, 0 errors in N.NNN seconds.
+ Ran 1 tests with 0 failures and 0 errors in 0.010 seconds.
+ Tear down z3c....UnitLayer1 in 0.000 seconds.
+ Total: 4 tests, 0 failures, 0 errors in 6.014 seconds.
False
-
As we can see, the layer `UnitLayer1` was executed here.
Convenience stuff for testers of z3c.testsetup
More information about the checkins
mailing list