-
大小: 31KB文件類(lèi)型: .py金幣: 1下載: 0 次發(fā)布日期: 2021-01-01
- 語(yǔ)言: Python
- 標(biāo)簽: 測(cè)試報(bào)告??selenium??
資源簡(jiǎn)介
1、增加報(bào)告加載樣式初始化,更多樣化
2、將失敗&錯(cuò)誤拆分成失敗和錯(cuò)誤
3、對(duì)標(biāo)簽切換方法進(jìn)行了優(yōu)化
代碼片段和文件信息
#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
評(píng)論
共有 條評(píng)論