HTMLTestRunner.py is a module extension above unittest in Python. With it, you can quickly generate an HTML test report. HTMLTestRunner is a counterpart to unittest's TextTestRunner. E.g.
import unittest
import HTMLTestRunner
... define your tests ...
if __name__ == '__main__':
HTMLTestRunner.main()
# output to a file
fp = file('my_report.html', 'wb')
runner = HTMLTestRunner.HTMLTestRunner(
stream=fp,
title='My unit test',
description='This demonstrates the report output by HTMLTestRunner.'
)
# Use an external stylesheet.
# See the Template_mixin class for more customizable options
runner.STYLESHEET_TMPL = '<link rel="stylesheet" href="my_stylesheet.css" type="text/css">'
# run the test
runner.run(my_test_suite)
HTMLTestRunner was an easy to use library as a developer to quickly see a webpage based report. It was originally created by tungwaiyip and upgraded recently for Python 3 by dash0002. In it's current iteration and maintenance, our goals are still the same; to be able to quickly generate an HTML test report.
Supporting Python 3 - 3.5
You can take a copy of the HTMLTestRunner.py and include it directly in your Project as-is.
python test_HTMLTestRunner.py
- Way Yip Tung - https://github.com/tungwaiyip
- Asish Dash - https://github.com/dash0002
- Dhruv Paranjape - https://github.com/dark-passenger
- Ethan Estrada - https://github.com/eestrada
Contributions are gladly accepted as this is a side project at best. Please, also consider this when looking at feedback cycles, issues, pull requests, etc.
HTMLTestRunner is licensed under http://choosealicense.com/licenses/bsd-3-clause/