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
d6aabcfe
Commit
d6aabcfe
authored
Sep 27, 2009
by
Michael Foord
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test creation moved from TestProgram.parseArgs to TestProgram.createTests exclusively. Issue 6956.
parent
716a9ccd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
Lib/unittest/main.py
Lib/unittest/main.py
+8
-5
No files found.
Lib/unittest/main.py
View file @
d6aabcfe
...
...
@@ -109,9 +109,9 @@ class TestProgram(object):
if
opt
in
(
'-v'
,
'--verbose'
):
self
.
verbosity
=
2
if
len
(
args
)
==
0
and
self
.
defaultTest
is
None
:
self
.
test
=
self
.
testLoader
.
loadTestsFromModule
(
self
.
module
)
return
if
len
(
args
)
>
0
:
# createTests will load tests from self.module
self
.
testNames
=
None
el
if
len
(
args
)
>
0
:
self
.
testNames
=
args
if
__name__
==
'__main__'
:
# to support python -m unittest ...
...
...
@@ -123,8 +123,11 @@ class TestProgram(object):
self
.
usageExit
(
msg
)
def
createTests
(
self
):
self
.
test
=
self
.
testLoader
.
loadTestsFromNames
(
self
.
testNames
,
self
.
module
)
if
self
.
testNames
is
None
:
self
.
test
=
self
.
testLoader
.
loadTestsFromModule
(
self
.
module
)
else
:
self
.
test
=
self
.
testLoader
.
loadTestsFromNames
(
self
.
testNames
,
self
.
module
)
def
_do_discovery
(
self
,
argv
,
Loader
=
loader
.
TestLoader
):
# handle command line args for test discovery
...
...
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