我已经安装了pytest-html,想用它在pycharm中运行pytest后生成html报告。
如下所示:

但它会弹出错误:
ERROR: file not found: html=report\result.html跑完之后。那么如何修改参数呢?
发布于 2019-11-05 02:24:34
使用
--html=Reports/Report.html --self-contained-html在pycharm的附加参数部分
发布于 2018-06-05 20:11:01
如果您使用终端来运行测试,请尝试这样做,这将会起作用。
py.test --html=demoreport.html 发布于 2019-03-22 16:12:21
如果您想通过pycharm运行,只需右键单击项目,请执行以下步骤:
pytest addopts =--html=报告/report.html python_files =测试/*..py
其中,test/*.py是包含所有测试的文件夹。
现在,只需右键单击您的项目并选择Run 'pytest in ProjectFolderName‘,您将发现已在名为Report.html的reports文件夹中创建了报告
https://stackoverflow.com/questions/50147527
复制相似问题