Message139007
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? |
|
Date |
User |
Action |
Args |
2011-06-25 00:22:50 | terry.reedy | set | recipients:
+ terry.reedy, rhettinger, michael.foord, branker |
2011-06-25 00:22:50 | terry.reedy | set | messageid: <1308961370.29.0.360180271022.issue12376@psf.upfronthosting.co.za> |
2011-06-25 00:22:49 | terry.reedy | link | issue12376 messages |
2011-06-25 00:22:49 | terry.reedy | create | |
|