Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
72b19772
Commit
72b19772
authored
May 10, 2010
by
Michael Foord
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improving help message for python -m unittest. Issue 8303.
parent
638b8690
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
6 deletions
+7
-6
Lib/unittest/__main__.py
Lib/unittest/__main__.py
+1
-1
Lib/unittest/main.py
Lib/unittest/main.py
+6
-5
No files found.
Lib/unittest/__main__.py
View file @
72b19772
...
...
@@ -2,7 +2,7 @@
import
sys
if
sys
.
argv
[
0
].
endswith
(
"__main__.py"
):
sys
.
argv
[
0
]
=
"unittest"
sys
.
argv
[
0
]
=
"
python -m
unittest"
__unittest
=
True
...
...
Lib/unittest/main.py
View file @
72b19772
...
...
@@ -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
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment