可以使用 BeautifulReport 提供的 merge 方法来合并多个测试报告,同时使用 set 去重,避免重复的内容被合并。

示例代码:

from BeautifulReport import BeautifulReport

report_list = ['report1.html', 'report2.html', 'report3.html']

merged_report = BeautifulReport.merge(report_list)
merged_report.set_title('Merged Report')

merged_report.save_report('merged_report.html')

在上面的示例代码中,首先定义了要合并的测试报告文件名列表 report_list,然后使用 BeautifulReport 的 merge 方法合并这些测试报告,得到一个新的测试报告对象 merged_report。接着使用 set 方法去重,避免重复的内容被合并。最后设置新测试报告的标题,保存到文件 merged_report.html 中。

Python 合并多个 BeautifulReport 测试报告并去重

原文地址: https://www.cveoy.top/t/topic/jvfA 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录