在使用 pytest 运行测试时,如果要使用 pytest-testreport 生成测试报告, 运行测试时加上参数 --report 指定报告文件名,即可实现。
那我们能不能用--report指定报告存储的文件夹位置?
pytest --report=musen.html --title=测试报告 --tester=木森 --desc=项目描述 --template=2
在使用 pytest 运行测试时,如果要使用 pytest-testreport 生成测试报告, 运行测试时加上参数 --report 指定报告文件名,即可实现。
那我们能不能用--report指定报告存储的文件夹位置?
pytest --report=musen.html --title=测试报告 --tester=木森 --desc=项目描述 --template=2
测试一下不就知道了
使用 pytest-html 插件来生成 HTML 格式的测试报告,并使用 --html 参数 可以指定报告存储的文件夹位置
pytest --html=path/to/html/report.html # 指定报告路径为path/to/html