• 大小: 46KB
    文件类型: .py
    金币: 1
    下载: 0 次
    发布日期: 2021-01-04
  • 语言: Python
  • 标签: Python  HTML  

资源简介

Python+Selenium自动化测试优化后的HTMLTestRunner测试报告

资源截图

代码片段和文件信息

# coding=utf-8
“““
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 HTMLTestRunner

    ... define your tests ...

    if __name__ == ‘__main__‘:
        HTMLTestRunner.main()


For more customization options instantiates a HTMLTestRunner object.
HTMLTestRunner is a counterpart to unittest‘s TextTestRunner. E.g.

    # 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.
    # Se

评论

共有 条评论