Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'TestResult' object has no attribute 'separator2' #63

Open
joeymizrahi opened this issue Dec 24, 2019 · 2 comments
Open

'TestResult' object has no attribute 'separator2' #63

joeymizrahi opened this issue Dec 24, 2019 · 2 comments

Comments

@joeymizrahi
Copy link

  • 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'
@Alessandro-D
Copy link

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?

@joeymizrahi
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants