Hello! Help, please resolve the issue. HTMLTestRunner after passing the test does not generate a report. Even an empty file does not create. To be precise, but after launching from the console, the file is created, but empty, and a bunch of errors related to the HTMLTestRunner fall out into the console itself. Because I am using python 3.5.1, it has been suggested that HTMLTestRunner is not adapted to work with this version. The simplest code for testing:

import unittest import HTMLTestRunner class TestFunctions(unittest.TestCase): def test_test1(self): pass def test_test2(self): pass if __name__ == '__main__': suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(TestFunctions)) # File buf = open("Report.html", 'wb') runner = HTMLTestRunner.HTMLTestRunner( stream=buf, title='Test the Report', description='Result of tests' ) runner.run(suite) 

In the body of HTMLTestRunner.py there are warnings: enter image description here

Also, there previously changed one line on the advice of one well-known community :

 import StringIO на from io import StringIO 

In general, nothing helped. We run tests from PyCharm - pass, but there is no report. Running from the console does not work, the report is empty, and then apparently the file itself is created thanks to buf = open("Report.html", 'wb')

  • The topic is closed. Found a solution. I can say for sure that the version of HTMLTestRunner that I downloaded from the official site is not suitable for Python 3.5.1. To work correctly, we had to manually make a change to its code, taking into account the specifics of 3.5.1. - blindeStern

1 answer 1

The topic is closed. Found a solution. I can say for sure that the version of HTMLTestRunner that I downloaded from the official site is not suitable for Python 3.5.1 . To work correctly, we had to manually make a change to its code, taking into account the specifics of 3.5.1. For example:
from io import StringIO - necessarily, just keep in mind that in 3.5.x str already decoded and
ue = e.decode('latin-1')
no need, right:
ue = e .
It is necessary to take into account that
has_key
not used, but "in"
cls in rmap .

  • A typical python problem is version incompatibility. Use Ruby, and you will be happy. - Nakilon