Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
生成我知道的 HTML 报告的一种方法是从系统终端运行,但我希望我的代码动态处理它,这样当我从终端运行代码时,我不必传递 --html=report.html参数。
--html=report.html
在运行 pytest 的目录中创建一个pytest.ini。addopts然后,您可以在运行 pytest 时使用该变量添加默认参数。看起来像这样的东西:
pytest.ini
addopts
[pytest] addopts = --html=reports/automation.html