300字范文,内容丰富有趣,生活中的好帮手!
300字范文 > pytest+allure生成测试报告打开allure报告数据为NaN%的解决方法

pytest+allure生成测试报告打开allure报告数据为NaN%的解决方法

时间:2023-06-12 20:15:17

相关推荐

pytest+allure生成测试报告打开allure报告数据为NaN%的解决方法

原因是 如果不进行格式化,会找不到报告输出的路径

具体代码如下:

import osimport pytestpath = os.path.dirname(os.path.dirname(__file__)) # 项目APi路径tempath = os.path.join(path, "report/temp") # 报告临时存放文件reportpath = os.path.join(path, "report/report") # 报告打开路径Casepath= os.path.join(path,"Testcase") # 测试集合路径# print(path2)pytest.main([Casepath,"-s","--alluredir", tempath])#运行 test_case下所有测试用例os.system(f'allure generate {tempath} -o {reportpath} -c')# os.system('allure generate tempath -o reportpath -c')

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。