HtmlTestRunner
HtmlTestRunner copied to clipboard
'TestResult' object has no attribute 'separator2'
- HtmlTestRunner version: 1.2.1
- Python version: 3.7.1
- Operating System: windows 10
Description
I am trying to define my own resultClass. This is because i need to do certain things when a unittest fails.
What I Did
import unittest
import HtmlTestRunner
if __name__ == '__main__':
runner = HtmlTestRunner.HTMLTestRunner(resultclass=TestResult)
unittest.main(testRunner=runner)
resulted in:
Traceback (most recent call last):
File "*****", line 179, in <module>
unittest.main(testRunner=runner)
File "C:\Program Files\Python37\lib\unittest\main.py", line 101, in __init__
self.runTests()
File "C:\Program Files\Python37\lib\unittest\main.py", line 271, in runTests
self.result = testRunner.run(self.test)
File "C:\Program Files\Python37\lib\site-packages\HtmlTestRunner\runner.py", line 69, in run
self.stream.writeln(result.separator2)
AttributeError: 'TestResult' object has no attribute 'separator2'
I am facing the same issue, as I am trying to pass a custom result class to display results through Zalenium.
is there any insight available?
I am facing the same issue, as I am trying to pass a custom result class to display results through Zalenium.
is there any insight available?
I never found any solutions, i ended up creating my own html report in an ugly way. would be happy to hear any ideas or solutions