![](/img/trans.png)
[英]How to rerun only failed test cases and get single report for passed and failed scripts in selenium python
[英]how to generate python unittesting report in XML format to summarize passed and failed test cases
我正在用python自動執行測試用例,默認情況下將結果重定向到文本文件以進行單元測試。 我希望結果以XML格式生成,以便可以輕松跟蹤通過和失敗的測試用例。 請提出建議。
有一個單獨的軟件包,稱為unittest-xml-reporting
要使用它,請將其添加到您的單元測試中
import xmlrunner
然后像這樣通過XMLRunner進行單元測試:
if __name__ == '__main__':
unittest.main(testRunner=xmlrunner.XMLTestRunner(output='test-reports'))
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.