Commit bf2ad346 authored by Michael Foord's avatar Michael Foord

Pass on parameters in unittest.TextTestResult.__init__ super call

parent fb2e8a7c
......@@ -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
......
......@@ -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):
......
......@@ -107,6 +107,8 @@ Core and Builtins
Library
-------
- Issue #12376: Pass on parameters in TextTestResult.__init__ super call
- Issue #15222: Insert blank line after each message in mbox mailboxes
- Issue #16013: Fix CSV Reader parsing issue with ending quote characters.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment