mirror of
https://github.com/python/cpython.git
synced 2025-10-04 22:20:46 +00:00
Move initialising unittest.TestProgram.testRunner into runTests. Issue 6418.
This commit is contained in:
parent
f4a96e07d8
commit
bee87b4c1c
2 changed files with 5 additions and 12 deletions
|
@ -800,8 +800,6 @@ Examples:
|
|||
def __init__(self, module='__main__', defaultTest=None,
|
||||
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:]:
|
||||
|
@ -851,6 +849,9 @@ Examples:
|
|||
self.module)
|
||||
|
||||
def runTests(self):
|
||||
if self.testRunner is None:
|
||||
self.testRunner = TextTestRunner
|
||||
|
||||
if isinstance(self.testRunner, (type, types.ClassType)):
|
||||
try:
|
||||
testRunner = self.testRunner(verbosity=self.verbosity)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue