summaryrefslogtreecommitdiffstats
path: root/Lib/unittest.py
diff options
context:
space:
mode:
authorMichael Foord <fuzzyman@voidspace.org.uk>2009-07-13 16:32:47 (GMT)
committerMichael Foord <fuzzyman@voidspace.org.uk>2009-07-13 16:32:47 (GMT)
commitbee87b4c1cfa89f0ca17e72874a17ea0ad126489 (patch)
treeda30abd0afd1f0bca2ca0326534b4996c1f36a94 /Lib/unittest.py
parentf4a96e07d8ae7ba868c22c93dec0e2bef13d3383 (diff)
downloadcpython-bee87b4c1cfa89f0ca17e72874a17ea0ad126489.zip
cpython-bee87b4c1cfa89f0ca17e72874a17ea0ad126489.tar.gz
cpython-bee87b4c1cfa89f0ca17e72874a17ea0ad126489.tar.bz2
Move initialising unittest.TestProgram.testRunner into runTests. Issue 6418.
Diffstat (limited to 'Lib/unittest.py')
-rw-r--r--Lib/unittest.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/unittest.py b/Lib/unittest.py
index 2ad5de7..74f15d6 100644
--- a/Lib/unittest.py
+++ b/Lib/unittest.py
@@ -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)