报错内容大概就是错没有找到某个json文件,实际是有的。
Could not read test result file .\report\json_report\23aa609b-f8c5-4842-b2fe-4179820f4e6d-result.json
可能的原因:
allure生成json数据是用pytest实现的
addopts = -s --alluredir=./report/json_report
然后生成html文件是用cmd命令实现的
os.system(r"allure generate .\report\json_report -o .\report\html_report --clean")
这边发现使用pip install 下载的allure-pytest 版本为 2.15.0
cmd看一下allure版本
两版本不一样
pycham重新安装一下allure-pytest,指定一下版本为2.14.x
重新运行,ok了
Report successfully generated to .\report\html_report