1

生成我知道的 HTML 报告的一种方法是从系统终端运行,但我希望我的代码动态处理它,这样当我从终端运行代码时,我不必传递 --html=report.html参数。

4

1 回答 1

1

在运行 pytest 的目录中创建一个pytest.iniaddopts然后,您可以在运行 pytest 时使用该变量添加默认参数。看起来像这样的东西:

pytest.ini

[pytest]
addopts = --html=reports/automation.html
于 2020-03-06T21:01:40.860 回答