[Zope3-checkins]
SVN: zope.testing/branches/ctheune-cleanup/src/zope/testing/testrunner/testrunner-layers-api.txt
Avoid instrumenting an internal API in preparation for the
next refactoring.
Christian Theune
ct at gocept.com
Sat May 3 18:10:29 EDT 2008
Log message for revision 86305:
Avoid instrumenting an internal API in preparation for the next refactoring.
Changed:
U zope.testing/branches/ctheune-cleanup/src/zope/testing/testrunner/testrunner-layers-api.txt
-=-
Modified: zope.testing/branches/ctheune-cleanup/src/zope/testing/testrunner/testrunner-layers-api.txt
===================================================================
--- zope.testing/branches/ctheune-cleanup/src/zope/testing/testrunner/testrunner-layers-api.txt 2008-05-03 22:08:48 UTC (rev 86304)
+++ zope.testing/branches/ctheune-cleanup/src/zope/testing/testrunner/testrunner-layers-api.txt 2008-05-03 22:10:28 UTC (rev 86305)
@@ -112,14 +112,15 @@
TestSpecifyingBaseLayer tests.
>>> from zope.testing.testrunner import Runner
->>> runner = Runner(options=fresh_options(), found_suites=[umbrella_suite])
->>> succeeded = runner.run_tests()
+>>> runner = Runner(options=fresh_options(), args=[], found_suites=[umbrella_suite])
+>>> succeeded = runner.run()
Running unit tests:
- Ran 2 tests with 0 failures and 0 errors in N.NNN seconds.
- Set up BaseLayer in N.NNN seconds.
- Ran 2 tests with 0 failures and 0 errors in N.NNN seconds.
+ Ran 2 tests with 0 failures and 0 errors in N.NNN seconds.
+Running BaseLayer tests:
+ Set up BaseLayer in N.NNN seconds.
+ Ran 2 tests with 0 failures and 0 errors in N.NNN seconds.
Tearing down left over layers:
- Tear down BaseLayer in N.NNN seconds.
+ Tear down BaseLayer in N.NNN seconds.
Total: 4 tests, 0 failures, 0 errors in N.NNN seconds.
Now lets specify a layer in the suite containing TestSpecifyingNoLayer
@@ -127,8 +128,9 @@
a layer. This is generally how you specify what layer doctests need.
>>> no_layer_suite.layer = BaseLayer
->>> runner = Runner(options=fresh_options(), found_suites=[umbrella_suite])
->>> succeeded = runner.run_tests()
+>>> runner = Runner(options=fresh_options(), args=[], found_suites=[umbrella_suite])
+>>> succeeded = runner.run()
+Running BaseLayer tests:
Set up BaseLayer in N.NNN seconds.
Ran 4 tests with 0 failures and 0 errors in N.NNN seconds.
Tearing down left over layers:
@@ -145,10 +147,12 @@
TestSpecifyingNoLayer tests are run.
>>> TestSpecifyingNoLayer.layer = TopLayer
->>> runner = Runner(options=fresh_options(), found_suites=[umbrella_suite])
->>> succeeded = runner.run_tests()
+>>> runner = Runner(options=fresh_options(), args=[], found_suites=[umbrella_suite])
+>>> succeeded = runner.run()
+Running BaseLayer tests:
Set up BaseLayer in N.NNN seconds.
Ran 2 tests with 0 failures and 0 errors in N.NNN seconds.
+Running TopLayer tests:
Set up TopLayer in N.NNN seconds.
Ran 2 tests with 0 failures and 0 errors in N.NNN seconds.
Tearing down left over layers:
@@ -156,6 +160,7 @@
Tear down BaseLayer in N.NNN seconds.
Total: 4 tests, 0 failures, 0 errors in N.NNN seconds.
+
If we inspect our trace of what methods got called in what order, we can
see that the layer setup and teardown methods only got called once. We can
also see that the layer's test setup and teardown methods got called for
@@ -227,23 +232,25 @@
... pass
>>> suite = unittest.makeSuite(DeepTest)
>>> log_handler.clear()
->>> runner = Runner(options=fresh_options(), found_suites=[suite])
->>> succeeded = runner.run_tests()
- Set up A in 0.000 seconds.
- Set up B in 0.000 seconds.
- Set up C in 0.000 seconds.
- Set up D in 0.000 seconds.
- Set up E in 0.000 seconds.
- Set up F in 0.000 seconds.
- Ran 1 tests with 0 failures and 0 errors in 0.003 seconds.
+>>> runner = Runner(options=fresh_options(), args=[], found_suites=[suite])
+>>> succeeded = runner.run()
+Running F tests:
+ Set up A in N.NNN seconds.
+ Set up B in N.NNN seconds.
+ Set up C in N.NNN seconds.
+ Set up D in N.NNN seconds.
+ Set up E in N.NNN seconds.
+ Set up F in N.NNN seconds.
+ Ran 1 tests with 0 failures and 0 errors in N.NNN seconds.
Tearing down left over layers:
- Tear down F in 0.000 seconds.
- Tear down E in 0.000 seconds.
- Tear down D in 0.000 seconds.
- Tear down C in 0.000 seconds.
- Tear down B in 0.000 seconds.
- Tear down A in 0.000 seconds.
+ Tear down F in N.NNN seconds.
+ Tear down E in N.NNN seconds.
+ Tear down D in N.NNN seconds.
+ Tear down C in N.NNN seconds.
+ Tear down B in N.NNN seconds.
+ Tear down A in N.NNN seconds.
+
>>> report()
A.setUp
B.setUp
@@ -269,4 +276,3 @@
C.tearDown
B.tearDown
A.tearDown
-
More information about the Zope3-Checkins
mailing list