[Checkins] SVN: z3c.testsetup/trunk/src/z3c/testsetup/ Let also simplesetup01 test setup tear down layers. This

Uli Fouquet uli at gnufix.de
Tue Sep 14 20:09:12 EDT 2010


Log message for revision 116422:
  Let also simplesetup01 test setup tear down layers. This
  should fix remaining windows problems with tests spread
  over different layers in different subprocesses.
  

Changed:
  U   z3c.testsetup/trunk/src/z3c/testsetup/README.txt
  U   z3c.testsetup/trunk/src/z3c/testsetup/tests/othercave/simplesetup01.py

-=-
Modified: z3c.testsetup/trunk/src/z3c/testsetup/README.txt
===================================================================
--- z3c.testsetup/trunk/src/z3c/testsetup/README.txt	2010-09-14 23:31:34 UTC (rev 116421)
+++ z3c.testsetup/trunk/src/z3c/testsetup/README.txt	2010-09-15 00:09:12 UTC (rev 116422)
@@ -91,12 +91,16 @@
     >>> print open(os.path.join(cavepath, 'simplesetup01.py')).read()
     import z3c.testsetup
     test_suite = z3c.testsetup.register_all_tests(
-        'z3c.testsetup.tests.othercave')
+        'z3c.testsetup.tests.othercave',
+        allow_teardown=True)
 
 This is all we need in simple cases. We use
-``register_all_tests(<dotted_pkg_name>)`` to tell the setup machinery, where
-to look for test files. Note that also files in subpackages will be found,
-registered and executed when they are marked approriately.
+``register_all_tests(<dotted_pkg_name>)`` to tell the setup machinery,
+where to look for test files. The ``allow_teardown`` parameter tells,
+that we allow tearing down functional tests, so that they don't have
+to be run in an isolated subprocess. Note that also files in
+subpackages will be found, registered and executed when they are
+marked approriately.
 
 Let's start the testrunner and see what it gives:
 
@@ -109,38 +113,35 @@
     >>> from z3c.testsetup import testrunner
     >>> testrunner.run(defaults)
     Running z3c...layer.DefaultZCMLLayer [...ftesting.zcml] tests:
-      Set up z3c...layer.DefaultZCMLLayer [...ftesting.zcml] in 2.146 seconds.
-      Ran 3 tests with 0 failures and 0 errors in 0.009 seconds.
+      Set up z3c...layer.DefaultZCMLLayer [...ftesting.zcml] in N.NNN seconds.
+      Ran 3 tests with 0 failures and 0 errors in N.NNN seconds.
     Running z3c...layer.DefaultZCMLLayer [...ftesting2.zcml] tests:
-      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
+      Tear down z3c...DefaultZCMLLayer [...ftesting.zcml] in N.NNN seconds.
+      Set up z3c...layer.DefaultZCMLLayer [...ftesting2.zcml] in N.NNN seconds.
+      Ran 1 tests with 0 failures and 0 errors in N.NNN seconds.
     Running z3c.testsetup.tests.othercave.testing.FunctionalLayer1 tests:
-      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.
+      Tear down z3c...DefaultZCMLLayer [...ftesting2.zcml] in N.NNN seconds.
+      Set up z3c....othercave.testing.FunctionalLayer1 in N.NNN seconds.
+      Ran 1 tests with 0 failures and 0 errors in N.NNN seconds.
     Running z3c.testsetup.tests.othercave.testing.UnitLayer2 tests:
-      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.
+      Tear down z3c...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 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 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.
+      Ran 1 tests with 0 failures and 0 errors in N.NNN seconds.
     Running zope...testrunner.layer.UnitTests tests:
-      Running in a subprocess.
+      Tear down z3c...othercave.testing.UnitLayer2 in N.NNN seconds.
+      Tear down z3c...othercave.testing.UnitLayer1 in N.NNN seconds.
       Set up zope...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 4 tests with 0 failures and 0 errors in 0.011 seconds.
-      Tear down zope...testrunner.layer.UnitTests in 0.000 seconds.
-    Total: 10 tests, 0 failures, 0 errors in 11.798 seconds.
+      Ran 4 tests with 0 failures and 0 errors in N.NNN seconds.
+    Tearing down left over layers:
+      Tear down zope...testrunner.layer.UnitTests in N.NNN seconds.
+    Total: 10 tests, 0 failures, 0 errors in N.NNN seconds.
     False
 
 As we can see, there were regular unittests as well as functional tests

Modified: z3c.testsetup/trunk/src/z3c/testsetup/tests/othercave/simplesetup01.py
===================================================================
--- z3c.testsetup/trunk/src/z3c/testsetup/tests/othercave/simplesetup01.py	2010-09-14 23:31:34 UTC (rev 116421)
+++ z3c.testsetup/trunk/src/z3c/testsetup/tests/othercave/simplesetup01.py	2010-09-15 00:09:12 UTC (rev 116422)
@@ -1,3 +1,4 @@
 import z3c.testsetup
 test_suite = z3c.testsetup.register_all_tests(
-    'z3c.testsetup.tests.othercave')
+    'z3c.testsetup.tests.othercave',
+    allow_teardown=True)



More information about the checkins mailing list