How to generate your Python Unit Test HTML Report?

3-Step to generate Python Unit Test HTML Report?

In this article, we will share how to generate your python unit testing results in HTML format.

Here is the example of the testing reports. Generating testing report in HTML format will help others to read and share the testing results.





Step 1: Download the


Step 2: Python Code Sample

[pastacode lang=”python” message=”Testing Results in HTML” highlight=”10,11″ provider=”manual”]

import unittest
import HTMLTestRunner

... define your tests here...

if __name__ == '__main__':



Step 3: Execution 

Assuming the file name of python source code is “” and the expected HTML testing results is “TestingResults.HTML”

Python   >   TestingResults.HTML




Leave a Reply

Your email address will not be published. Required fields are marked *