[Python-checkins] r79679 - python/trunk/Lib/unittest/main.py

michael.foord python-checkins at python.org
Sat Apr 3 16:52:18 CEST 2010


Author: michael.foord
Date: Sat Apr  3 16:52:18 2010
New Revision: 79679

Log:
Adding -b command line option to the unittest usage message.

Modified:
   python/trunk/Lib/unittest/main.py

Modified: python/trunk/Lib/unittest/main.py
==============================================================================
--- python/trunk/Lib/unittest/main.py	(original)
+++ python/trunk/Lib/unittest/main.py	Sat Apr  3 16:52:18 2010
@@ -9,9 +9,9 @@
 
 __unittest = True
 
-
-FAILFAST = "  -f, --failfast   Stop on first failure\n"
-CATCHBREAK = "  -c, --catch      Catch control-C and display results\n"
+FAILFAST     = "  -f, --failfast   Stop on first failure\n"
+CATCHBREAK   = "  -c, --catch      Catch control-C and display results\n"
+BUFFEROUTPUT = "  -b, --buffer     Buffer stdout and stderr during test runs\n"
 
 USAGE_AS_MAIN = """\
 Usage: %(progName)s [options] [tests]
@@ -20,7 +20,7 @@
   -h, --help       Show this message
   -v, --verbose    Verbose output
   -q, --quiet      Minimal output
-%(failfast)s%(catchbreak)s
+%(failfast)s%(catchbreak)s%(buffer)s
 Examples:
   %(progName)s test_module                       - run tests from test_module
   %(progName)s test_module.TestClass             - run tests from
@@ -34,7 +34,7 @@
 
 Options:
   -v, --verbose    Verbose output
-%(failfast)s%(catchbreak)s  -s directory     Directory to start discovery ('.' default)
+%(failfast)s%(catchbreak)s%(buffer)s  -s directory     Directory to start discovery ('.' default)
   -p pattern       Pattern to match test files ('test*.py' default)
   -t directory     Top level directory of project (default to
                    start directory)
@@ -50,7 +50,7 @@
   -h, --help       Show this message
   -v, --verbose    Verbose output
   -q, --quiet      Minimal output
-%(failfast)s%(catchbreak)s
+%(failfast)s%(catchbreak)s%(buffer)s
 Examples:
   %(progName)s                               - run default set of tests
   %(progName)s MyTestSuite                   - run suite 'MyTestSuite'
@@ -103,6 +103,8 @@
             usage['failfast'] = FAILFAST
         if self.catchbreak != False:
             usage['catchbreak'] = CATCHBREAK
+        if self.buffer != False:
+            usage['buffer'] = BUFFEROUTPUT
         print self.USAGE % usage
         sys.exit(2)
 


More information about the Python-checkins mailing list