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')

 


本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!

相关文章

立即
投稿

微信公众账号

微信扫一扫加关注

返回
顶部