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
48bc8203
Commit
48bc8203
authored
Jun 02, 2009
by
Michael Foord
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Restore default testRunner argument in unittest.main to None. Issue 6177.
parent
05f26d88
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
2 deletions
+15
-2
Lib/test/test_unittest.py
Lib/test/test_unittest.py
+12
-1
Lib/unittest.py
Lib/unittest.py
+3
-1
No files found.
Lib/test/test_unittest.py
View file @
48bc8203
...
...
@@ -2284,6 +2284,17 @@ class Test_Assertions(TestCase):
self
.
assertRaises
(
AssertionError
,
self
.
failIfAlmostEqual
,
0
,
.
1
+
.
1j
,
places
=
0
)
class
Test_TestProgram
(
TestCase
):
def
testTestProgram_testRunnerArgument
(
self
):
program
=
object
.
__new__
(
unittest
.
TestProgram
)
program
.
parseArgs
=
lambda
_
:
None
program
.
runTests
=
lambda
:
None
program
.
__init__
(
testRunner
=
None
)
self
.
assertEqual
(
program
.
testRunner
,
unittest
.
TextTestRunner
)
######################################################################
## Main
######################################################################
...
...
@@ -2291,7 +2302,7 @@ class Test_Assertions(TestCase):
def
test_main
():
test_support
.
run_unittest
(
Test_TestCase
,
Test_TestLoader
,
Test_TestSuite
,
Test_TestResult
,
Test_FunctionTestCase
,
Test_Assertions
)
Test_Assertions
,
Test_TestProgram
)
if
__name__
==
"__main__"
:
test_main
()
Lib/unittest.py
View file @
48bc8203
...
...
@@ -798,8 +798,10 @@ Examples:
in MyTestCase
"""
def
__init__
(
self
,
module
=
'__main__'
,
defaultTest
=
None
,
argv
=
None
,
testRunner
=
TextTestRunner
,
argv
=
None
,
testRunner
=
None
,
testLoader
=
defaultTestLoader
):
if
testRunner
is
None
:
testRunner
=
TextTestRunner
if
type
(
module
)
==
type
(
''
):
self
.
module
=
__import__
(
module
)
for
part
in
module
.
split
(
'.'
)[
1
:]:
...
...
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