1、新建"main_run.py文件
python
import pytest
import os
if __name__ == '__main__':
# 通过pytest 运行 并且生成allure 报告,在报告里面打印需要去掉"---vs"里面的"s"!!
# 第一步:指定运行文件,通过文件会生成结果的数据,每次运行前会清空历史数据
# "./testcase/" 运行testcase下的所有文件,也可以指定一个文件
pytest.main(["-vs", "./testcase/","--alluredir", "./result", "--clean-alluredir"])
# 第二步:把数据转成测试报告(HTML)
os.system("allure generate ./result -o ./report_allure --clean")
