Terry J. Reedy <tjre...@udel.edu> added the comment:

Running your code with 2.7.2 gives:
Traceback (most recent call last):
  File "C:\Programs\Python27\misc\tem.py", line 41, in <module>
    unittest.main(testRunner=runner)
  File "C:\Programs\Python27\lib\unittest\main.py", line 95, in __init__
    self.runTests()
  File "C:\Programs\Python27\lib\unittest\main.py", line 229, in runTests
    self.result = testRunner.run(self.test)
  File "C:\Programs\Python27\lib\unittest\runner.py", line 142, in run
    result = self._makeResult()
  File "C:\Programs\Python27\lib\unittest\runner.py", line 138, in _makeResult
    return self.resultclass(self.stream, self.descriptions, self.verbosity)
  File "C:\Programs\Python27\lib\unittest\runner.py", line 37, in __init__
    super(TextTestResult, self).__init__()
TypeError: __init__() takes exactly 4 arguments (1 given)

Nothing 'explodes', just a normal exception due to what I believe is a 
programming error on your part that has nothing to do with unittest. The doc 
for super says
"The second use case is to support cooperative multiple inheritance in a 
dynamic execution environment. This use case is unique to Python and is not 
found in statically compiled languages or languages that only support single 
inheritance. This makes it possible to implement “diamond diagrams” where 
multiple base classes implement the same method. Good design dictates that this 
method have the same calling signature in every case (because the order of 
calls is determined at runtime, because that order adapts to changes in the 
class hierarchy, and because that order can include sibling classes that are 
unknown prior to runtime).""

The various __init__ methods, as you know, have different and incompatible 
calling signatures, hence the exception. I believe this should be closed as 
invalid. Raymond, as super expert, do I have this right?

----------
nosy: +rhettinger, terry.reedy

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue12376>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to