[Zope3-checkins] SVN: zope.testing/trunk/src/zope/testing/testrunner Added quiet option.

Jim Fulton jim at zope.com
Mon Oct 24 16:30:05 EDT 2005


Log message for revision 39604:
  Added quiet option.
  

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

-=-
Modified: zope.testing/trunk/src/zope/testing/testrunner-verbose.txt
===================================================================
--- zope.testing/trunk/src/zope/testing/testrunner-verbose.txt	2005-10-24 20:22:46 UTC (rev 39603)
+++ zope.testing/trunk/src/zope/testing/testrunner-verbose.txt	2005-10-24 20:30:05 UTC (rev 39604)
@@ -135,3 +135,20 @@
       Tear down samplelayers.Layer12 in 0.000 seconds.
       Tear down samplelayers.Layer1 in 0.000 seconds.
     False
+
+Quiet output
+------------
+
+The --quiet (-q) option cancels all verbose options.  It's useful when
+the default verbosity is non-zero:
+
+    >>> defaults = [
+    ...     '--path', directory_with_tests,
+    ...     '--tests-pattern', '^sampletestsf?$',
+    ...     '-v'
+    ...     ]
+    >>> sys.argv = 'test -q -u'.split()
+    >>> testrunner.run(defaults)
+    Running unit tests:
+      Ran 192 tests with 0 failures and 0 errors in 0.034 seconds.
+    False

Modified: zope.testing/trunk/src/zope/testing/testrunner.py
===================================================================
--- zope.testing/trunk/src/zope/testing/testrunner.py	2005-10-24 20:22:46 UTC (rev 39603)
+++ zope.testing/trunk/src/zope/testing/testrunner.py	2005-10-24 20:30:05 UTC (rev 39604)
@@ -1093,10 +1093,17 @@
 reporting.add_option(
     '--verbose', '-v', action="count", dest='verbose',
     help="""\
+Make output more verbose.
 Increment the verbosity level.
 """)
 
 reporting.add_option(
+    '--quiet', '-q', action="store_true", dest='quiet',
+    help="""\
+Make the output minimal, overriding any verbosity options.
+""")
+
+reporting.add_option(
     '--progress', '-p', action="store_true", dest='progress',
     help="""\
 Output progress status
@@ -1390,6 +1397,9 @@
     if options.usecompiled:
         options.keepbytecode = options.usecompiled
 
+    if options.quiet:
+        options.verbose = 0
+
     return options
 
 # Command-line UI



More information about the Zope3-Checkins mailing list