[Zope3-checkins] SVN: zope.testing/trunk/src/zope/testing/testrunner Added a test for the --repeat option.

Jim Fulton jim at zope.com
Sun Oct 9 15:31:59 EDT 2005


Log message for revision 39024:
  Added a test for the --repeat option.
  

Changed:
  A   zope.testing/trunk/src/zope/testing/testrunner-repeat.txt
  U   zope.testing/trunk/src/zope/testing/testrunner.py
  U   zope.testing/trunk/src/zope/testing/testrunner.txt

-=-
Added: zope.testing/trunk/src/zope/testing/testrunner-repeat.txt
===================================================================
--- zope.testing/trunk/src/zope/testing/testrunner-repeat.txt	2005-10-09 19:31:57 UTC (rev 39023)
+++ zope.testing/trunk/src/zope/testing/testrunner-repeat.txt	2005-10-09 19:31:59 UTC (rev 39024)
@@ -0,0 +1,49 @@
+Test Runner
+===========
+
+Repeating Tests
+---------------
+
+The --repeat option can be used to repeat tests some number of times.
+Repeating tests is useful to help make sure that tests clean up after
+themselves.
+
+    >>> import os.path, sys
+    >>> directory_with_tests = os.path.join(this_directory, 'testrunner-ex')
+    >>> defaults = [
+    ...     '--path', directory_with_tests,
+    ...     '--tests-pattern', '^sampletestsf?$',
+    ...     ]
+
+    >>> sys.argv = 'test --layer 112 --layer unit --repeat 3'.split()
+    >>> from zope.testing import testrunner
+    >>> testrunner.run(defaults)
+    Running unit tests:
+    Iteration 1
+      Ran 192 tests with 0 failures and 0 errors in 0.054 seconds.
+    Iteration 2
+      Ran 192 tests with 0 failures and 0 errors in 0.054 seconds.
+    Iteration 3
+      Ran 192 tests with 0 failures and 0 errors in 0.052 seconds.
+    Running samplelayers.Layer112 tests:
+      Set up samplelayers.Layerx in 0.000 seconds.
+      Set up samplelayers.Layer1 in 0.000 seconds.
+      Set up samplelayers.Layer11 in 0.000 seconds.
+      Set up samplelayers.Layer112 in 0.000 seconds.
+    Iteration 1
+      Ran 34 tests with 0 failures and 0 errors in 0.010 seconds.
+    Iteration 2
+      Ran 34 tests with 0 failures and 0 errors in 0.010 seconds.
+    Iteration 3
+      Ran 34 tests with 0 failures and 0 errors in 0.010 seconds.
+    Tearing down left over layers:
+      Tear down samplelayers.Layer112 in 0.000 seconds.
+      Tear down samplelayers.Layerx in 0.000 seconds.
+      Tear down samplelayers.Layer11 in 0.000 seconds.
+      Tear down samplelayers.Layer1 in 0.000 seconds.
+    Total: 678 tests, 0 failures, 0 errors
+    False
+
+The tests are repeated by layer.  Layers are set up and torn down only
+once.
+ 


Property changes on: zope.testing/trunk/src/zope/testing/testrunner-repeat.txt
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: zope.testing/trunk/src/zope/testing/testrunner.py
===================================================================
--- zope.testing/trunk/src/zope/testing/testrunner.py	2005-10-09 19:31:57 UTC (rev 39023)
+++ zope.testing/trunk/src/zope/testing/testrunner.py	2005-10-09 19:31:59 UTC (rev 39024)
@@ -1437,6 +1437,7 @@
         'testrunner-test-selection.txt',
         'testrunner-verbose.txt',
         'testrunner-wo-source.txt',
+        'testrunner-repeat.txt',
         setUp=setUp, tearDown=tearDown,
         optionflags=doctest.ELLIPSIS+doctest.NORMALIZE_WHITESPACE,
         checker=checker)

Modified: zope.testing/trunk/src/zope/testing/testrunner.txt
===================================================================
--- zope.testing/trunk/src/zope/testing/testrunner.txt	2005-10-09 19:31:57 UTC (rev 39023)
+++ zope.testing/trunk/src/zope/testing/testrunner.txt	2005-10-09 19:31:59 UTC (rev 39024)
@@ -81,4 +81,5 @@
 - `Layers that can't be torn down <testrunner-layers-ntd.txt>`_
 - `Code Coverage <testrunner-coverage.txt>`_
 - `Running Without Source Code <testrunner-wo-source.txt>`_
+- `Repeating Tests <testrunner-looping.txt>`_
 - `Edge Cases <testrunner-edge-cases.txt>`_



More information about the Zope3-Checkins mailing list