summaryrefslogtreecommitdiffstats
path: root/Lib/unittest
diff options
context:
space:
mode:
authorMichael Foord <michael@voidspace.org.uk>2012-09-28 11:54:56 (GMT)
committerMichael Foord <michael@voidspace.org.uk>2012-09-28 11:54:56 (GMT)
commitbf2ad34650f02c277826554d211deac5539b1477 (patch)
tree7dad393b941c121df6f9cb6d14ec394a04e257b5 /Lib/unittest
parentfb2e8a7c01f5411e9b3c1bc02944e67f75d5b73b (diff)
downloadcpython-bf2ad34650f02c277826554d211deac5539b1477.zip
cpython-bf2ad34650f02c277826554d211deac5539b1477.tar.gz
cpython-bf2ad34650f02c277826554d211deac5539b1477.tar.bz2
Pass on parameters in unittest.TextTestResult.__init__ super call
Diffstat (limited to 'Lib/unittest')
-rw-r--r--Lib/unittest/runner.py2
-rw-r--r--Lib/unittest/test/test_runner.py13
2 files changed, 14 insertions, 1 deletions
diff --git a/Lib/unittest/runner.py b/Lib/unittest/runner.py
index 1716891..7632fe9 100644
--- a/Lib/unittest/runner.py
+++ b/Lib/unittest/runner.py
@@ -34,7 +34,7 @@ class TextTestResult(result.TestResult):
separator2 = '-' * 70
def __init__(self, stream, descriptions, verbosity):
- super(TextTestResult, self).__init__()
+ super(TextTestResult, self).__init__(stream, descriptions, verbosity)
self.stream = stream
self.showAll = verbosity > 1
self.dots = verbosity == 1
diff --git a/Lib/unittest/test/test_runner.py b/Lib/unittest/test/test_runner.py
index 6df6a9c..d1cefae 100644
--- a/Lib/unittest/test/test_runner.py
+++ b/Lib/unittest/test/test_runner.py
@@ -149,6 +149,19 @@ class Test_TextTestRunner(unittest.TestCase):
self.assertEqual(runner.resultclass, unittest.TextTestResult)
+ def test_multiple_inheritance(self):
+ class AResult(unittest.TestResult):
+ def __init__(self, stream, descriptions, verbosity):
+ super(AResult, self).__init__(stream, descriptions, verbosity)
+
+ class ATextResult(unittest.TextTestResult, AResult):
+ pass
+
+ # This used to raise an exception due to TextTestResult not passing
+ # on arguments in its __init__ super call
+ ATextResult(None, None, None)
+
+
def testBufferAndFailfast(self):
class Test(unittest.TestCase):
def testFoo(self):