开源unittest测试报告源码BSTestRunner.py
开源BSTestRunner 生成HTML测试报告源码: 保存代码到BSTestRunner.py 配合Unittest使用,很完美。 python2: """ 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 ... define your tests ... 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(