summaryrefslogtreecommitdiffstats
path: root/Lib/unittest
diff options
context:
space:
mode:
authorMichael Foord <fuzzyman@voidspace.org.uk>2010-04-03 14:52:18 (GMT)
committerMichael Foord <fuzzyman@voidspace.org.uk>2010-04-03 14:52:18 (GMT)
commitd43b63fed34ae19259e0d0ddb4d3604413b3c329 (patch)
tree8efdd4477a8a43a18ac59f6667cf6cc554268830 /Lib/unittest
parent856a3be76a974f0282705b086ce0ac2bacabbb49 (diff)
downloadcpython-d43b63fed34ae19259e0d0ddb4d3604413b3c329.zip
cpython-d43b63fed34ae19259e0d0ddb4d3604413b3c329.tar.gz
cpython-d43b63fed34ae19259e0d0ddb4d3604413b3c329.tar.bz2
Adding -b command line option to the unittest usage message.
Diffstat (limited to 'Lib/unittest')
-rw-r--r--Lib/unittest/main.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/Lib/unittest/main.py b/Lib/unittest/main.py
index 7c1f48c..b53af05 100644
--- a/Lib/unittest/main.py
+++ b/Lib/unittest/main.py
@@ -9,9 +9,9 @@ from .signals import installHandler
__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 @@ Options:
-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 @@ Alternative Usage: %(progName)s discover [options]
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 @@ Options:
-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 @@ class TestProgram(object):
usage['failfast'] = FAILFAST
if self.catchbreak != False:
usage['catchbreak'] = CATCHBREAK
+ if self.buffer != False:
+ usage['buffer'] = BUFFEROUTPUT
print self.USAGE % usage
sys.exit(2)