[Zope3-checkins] SVN: zope.testing/trunk/src/zope/testing/testrunner To me ./test.py -fu means "run both unit and non-unit tests". Make it

Marius Gedminas marius at pov.lt
Sun Jan 14 14:09:15 EST 2007


Log message for revision 72028:
  To me ./test.py -fu means "run both unit and non-unit tests".  Make it
  so that the test runner agrees.
  
  The older interpetation (test.py -fu means "always run 0 tests") is obviously
  useless.
  
  Merged from the test-fu branch with
  
    svn merge -r 71987:71992 svn+ssh://svn.zope.org/repos/main/zope.testing/branches/test-fu .
  
  

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

-=-
Modified: zope.testing/trunk/src/zope/testing/testrunner-layers.txt
===================================================================
--- zope.testing/trunk/src/zope/testing/testrunner-layers.txt	2007-01-14 14:57:11 UTC (rev 72027)
+++ zope.testing/trunk/src/zope/testing/testrunner-layers.txt	2007-01-14 19:09:14 UTC (rev 72028)
@@ -74,3 +74,44 @@
       Tear down samplelayers.Layer1 in N.NNN seconds.
     Total: 213 tests, 0 failures, 0 errors
     False
+
+Or we can explicitly say that we want both unit and non-unit tests.
+
+    >>> sys.argv = 'test -uf'.split()
+    >>> testrunner.run(defaults)
+    Running unit tests:
+      Ran 192 tests with 0 failures and 0 errors in 0.033 seconds.
+    Running samplelayers.Layer1 tests:
+      Set up samplelayers.Layer1 in N.NNN seconds.
+      Ran 9 tests with 0 failures and 0 errors in N.NNN seconds.
+    Running samplelayers.Layer11 tests:
+      Set up samplelayers.Layer11 in N.NNN seconds.
+      Ran 34 tests with 0 failures and 0 errors in N.NNN seconds.
+    Running samplelayers.Layer111 tests:
+      Set up samplelayers.Layerx in N.NNN seconds.
+      Set up samplelayers.Layer111 in N.NNN seconds.
+      Ran 34 tests with 0 failures and 0 errors in N.NNN seconds.
+    Running samplelayers.Layer112 tests:
+      Tear down samplelayers.Layer111 in N.NNN seconds.
+      Set up samplelayers.Layer112 in N.NNN seconds.
+      Ran 34 tests with 0 failures and 0 errors in N.NNN seconds.
+    Running samplelayers.Layer12 tests:
+      Tear down samplelayers.Layer112 in N.NNN seconds.
+      Tear down samplelayers.Layerx in N.NNN seconds.
+      Tear down samplelayers.Layer11 in N.NNN seconds.
+      Set up samplelayers.Layer12 in N.NNN seconds.
+      Ran 34 tests with 0 failures and 0 errors in N.NNN seconds.
+    Running samplelayers.Layer121 tests:
+      Set up samplelayers.Layer121 in N.NNN seconds.
+      Ran 34 tests with 0 failures and 0 errors in N.NNN seconds.
+    Running samplelayers.Layer122 tests:
+      Tear down samplelayers.Layer121 in N.NNN seconds.
+      Set up samplelayers.Layer122 in N.NNN seconds.
+      Ran 34 tests with 0 failures and 0 errors in N.NNN seconds.
+    Tearing down left over layers:
+      Tear down samplelayers.Layer122 in N.NNN seconds.
+      Tear down samplelayers.Layer12 in N.NNN seconds.
+      Tear down samplelayers.Layer1 in N.NNN seconds.
+    Total: 405 tests, 0 failures, 0 errors
+    False
+

Modified: zope.testing/trunk/src/zope/testing/testrunner.py
===================================================================
--- zope.testing/trunk/src/zope/testing/testrunner.py	2007-01-14 14:57:11 UTC (rev 72027)
+++ zope.testing/trunk/src/zope/testing/testrunner.py	2007-01-14 19:09:14 UTC (rev 72028)
@@ -1826,6 +1826,13 @@
     if options.all:
         options.at_level = sys.maxint
 
+    if options.unit and options.non_unit:
+        # The test runner interprets this as "run only those tests that are
+        # both unit and non-unit at the same time".  The user, however, wants
+        # to run both unit and non-unit tests.  Disable the filtering so that
+        # the user will get what she wants:
+        options.unit = options.non_unit = False
+
     if options.unit:
         options.layer = ['unit']
     if options.layer:



More information about the Zope3-Checkins mailing list