如何使用pytest生成测试报告? [英] How to generate test report using pytest?
本文介绍了如何使用pytest生成测试报告?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何使用 pytest 生成测试报告?我搜索了它,但我得到的都是关于覆盖率报告的.我试过这个命令:
How can I generate test report using pytest? I searched for it but whatever i got was about coverage report. I tried with this command:
py.test sanity_tests.py --cov=C:\Test\pytest --cov-report=xml
但作为参数表示它生成覆盖报告而不是测试报告.请帮忙!!
But as parameters represents it generates coverage report not test report. Please help!!
推荐答案
从评论中删除:您可以使用 --junitxml
参数.
Ripped from the comments: you can use the --junitxml
argument.
$ py.test sample_tests.py --junitxml=C:\path\to\out_report.xml
这篇关于如何使用pytest生成测试报告?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文