pytest+allure下生成allure的html报告后,报告没数据的解决方法

allure报告最近操作比较多,现记录一下比较容易出现混淆的脚本路径问题。

#生成allure的报告
pytest.main([‘xiaomi_search2.py’, ‘-s’, ‘–alluredir=report/html’])

#生成allure的html报告,其中report/html的路径必须与生成allure的路径必须一致,否则生成的html报告会没有数据。
os.system(‘allure generate report/html -o E:/UItest/DemoUI/report/ --clean’)

正确方法如截图:
pytest+allure下生成allure的html报告后,报告没数据的解决方法