HtmlTestRunner icon indicating copy to clipboard operation
HtmlTestRunner copied to clipboard

'TestResult' object has no attribute 'separator2'

Open joeymizrahi opened this issue 5 years ago • 2 comments

  • 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'

joeymizrahi avatar Dec 24 '19 22:12 joeymizrahi

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?

Alessandro-D avatar Sep 22 '20 10:09 Alessandro-D

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

joeymizrahi avatar Sep 23 '20 15:09 joeymizrahi