Skip to content
BSTestRunner is an extension to the Python standard library's unittest module. It generates easy to use HTML test reports.
HTML Python
Branch: master
Clone or download
Pull request Compare This branch is 7 commits ahead of tungwaiyip:master.
Latest commit 7ee7685 Nov 19, 2017
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
BSTestRunner.py
README.md add python3 support Nov 19, 2017
bs_test_result.html modify README Sep 27, 2016
demo.py fix issues in python3 and add demo Nov 19, 2017
demo_report.html fix issues in python3 and add demo Nov 19, 2017
report.png add screenshot Sep 27, 2016
sample_test_report.html updated sample to 0.8.2 Mar 28, 2011
test_BSTestRunner.py fix issues in python3 and add demo Nov 19, 2017

README.md

BSTestRunner is bootstrap3 version of HTMLTestRunner

Now support both python2 and python3

report

How to use

A TestRunner for use with the Python unit testing framework. It generates a HTML report to show the result at a glance.

The simplest way to use this is to invoke its main method. E.g.

import unittest
import BSTestRunner

if __name__ == '__main__':
    BSTestRunner.main()

For more customization options, instantiates a BSTestRunner object. BSTestRunner is a counterpart to unittest's TextTestRunner. E.g.

# output to a file
fp = file('my_report.html', 'wb')
runner = BSTestRunner.BSTestRunner(
            stream=fp,
            title='My unit test',
            description='This demonstrates the report output by BSTestRunner.'
            )

# 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)
You can’t perform that action at this time.