[Zope3-checkins] SVN: zope.testing/branches/test-fu/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
Fri Jan 12 18:05:05 EST 2007


Log message for revision 71988:
  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.
  
  

Changed:
  U   zope.testing/branches/test-fu/src/zope/testing/testrunner-layers.txt
  U   zope.testing/branches/test-fu/src/zope/testing/testrunner.py

-=-
Modified: zope.testing/branches/test-fu/src/zope/testing/testrunner-layers.txt
===================================================================
--- zope.testing/branches/test-fu/src/zope/testing/testrunner-layers.txt	2007-01-12 23:03:56 UTC (rev 71987)
+++ zope.testing/branches/test-fu/src/zope/testing/testrunner-layers.txt	2007-01-12 23:05:04 UTC (rev 71988)
@@ -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/branches/test-fu/src/zope/testing/testrunner.py
===================================================================
--- zope.testing/branches/test-fu/src/zope/testing/testrunner.py	2007-01-12 23:03:56 UTC (rev 71987)
+++ zope.testing/branches/test-fu/src/zope/testing/testrunner.py	2007-01-12 23:05:04 UTC (rev 71988)
@@ -1826,6 +1826,13 @@
     if options.all:
         options.at_level = sys.maxint
 
+    if options.unit and options.non_unit:
+        # The test runner interpets 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