diff options
author | Michael Foord <fuzzyman@voidspace.org.uk> | 2010-05-10 20:23:58 (GMT) |
---|---|---|
committer | Michael Foord <fuzzyman@voidspace.org.uk> | 2010-05-10 20:23:58 (GMT) |
commit | f707aa7f8b8540439b2444edd1028665317a0466 (patch) | |
tree | 5676c36a275bda43068d45cbbc33d512c1e38ffd /Lib/unittest/main.py | |
parent | 85eacea31e508666db1ce29827308e98fba1bc21 (diff) | |
download | cpython-f707aa7f8b8540439b2444edd1028665317a0466.zip cpython-f707aa7f8b8540439b2444edd1028665317a0466.tar.gz cpython-f707aa7f8b8540439b2444edd1028665317a0466.tar.bz2 |
Merged revisions 81055 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r81055 | michael.foord | 2010-05-10 21:21:16 +0100 (Mon, 10 May 2010) | 1 line
Improving help message for python -m unittest. Issue 8303.
........
Diffstat (limited to 'Lib/unittest/main.py')
-rw-r--r-- | Lib/unittest/main.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Lib/unittest/main.py b/Lib/unittest/main.py index 45af699..6acff8f 100644 --- a/Lib/unittest/main.py +++ b/Lib/unittest/main.py @@ -22,10 +22,9 @@ Options: -q, --quiet Minimal output %(failfast)s%(catchbreak)s%(buffer)s Examples: - %(progName)s test_module - run tests from test_module - %(progName)s test_module.TestClass - run tests from - test_module.TestClass - %(progName)s test_module.TestClass.test_method - run specified test method + %(progName)s test_module - run tests from test_module + %(progName)s module.TestClass - run tests from module.TestClass + %(progName)s module.Class.test_method - run specified test method [tests] can be a list of any number of test modules, classes and test methods. @@ -68,7 +67,7 @@ class TestProgram(object): USAGE = USAGE_FROM_MODULE # defaults for testing - failfast = catchbreak = buffer = None + failfast = catchbreak = buffer = progName = None def __init__(self, module='__main__', defaultTest=None, argv=None, testRunner=None, testLoader=loader.defaultTestLoader, @@ -160,8 +159,10 @@ class TestProgram(object): def _do_discovery(self, argv, Loader=loader.TestLoader): # handle command line args for test discovery + self.progName = '%s discover' % self.progName import optparse parser = optparse.OptionParser() + parser.prog = self.progName parser.add_option('-v', '--verbose', dest='verbose', default=False, help='Verbose output', action='store_true') if self.failfast != False: |