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
b36c70c9
Commit
b36c70c9
authored
Mar 12, 2012
by
Michael Foord
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move adding unittest test discovery command line options into their own method.
parent
c1f5d8af
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
Lib/unittest/main.py
Lib/unittest/main.py
+7
-5
No files found.
Lib/unittest/main.py
View file @
b36c70c9
...
...
@@ -211,11 +211,7 @@ class TestProgram(object):
elif
options
.
quiet
:
self
.
verbosity
=
0
def
_do_discovery
(
self
,
argv
,
Loader
=
loader
.
TestLoader
):
# handle command line args for test discovery
self
.
progName
=
'%s discover'
%
self
.
progName
parser
=
self
.
_getOptParser
()
def
_addDiscoveryOptions
(
self
,
parser
):
parser
.
add_option
(
'-s'
,
'--start-directory'
,
dest
=
'start'
,
default
=
'.'
,
help
=
"Directory to start discovery ('.' default)"
)
parser
.
add_option
(
'-p'
,
'--pattern'
,
dest
=
'pattern'
,
default
=
'test*.py'
,
...
...
@@ -223,6 +219,12 @@ class TestProgram(object):
parser
.
add_option
(
'-t'
,
'--top-level-directory'
,
dest
=
'top'
,
default
=
None
,
help
=
'Top level directory of project (defaults to start directory)'
)
def
_do_discovery
(
self
,
argv
,
Loader
=
loader
.
TestLoader
):
# handle command line args for test discovery
self
.
progName
=
'%s discover'
%
self
.
progName
parser
=
self
.
_getOptParser
()
self
.
_addDiscoveryOptions
(
parser
)
options
,
args
=
parser
.
parse_args
(
argv
)
if
len
(
args
)
>
3
:
self
.
usageExit
()
...
...
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