繁体   English   中英

如何在程序中使用pytest-html生成html报告和IDE PyCharm?

[英]How do you use pytest-html in a program to generate a html report and the IDE PyCharm?

我正在从 PyCharm 启动我的测试,一旦完成,我想创建一个报告。 我怎样才能在我的代码中做到这一点?

只见pytest_html模块,但我只看到一个命令( pytest --html=report.html --self-contained-html )穿上CMD.EXE,我想知道如何直接在我的计划做thaht?

在编辑配置中添加--html = Reports / Report.html此为其他农产品

一种选择是:

import subprocess
subprocess.run("pytest --html=report.html --self-contained-html",shell=True)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM