简体   繁体   English

pytest-html 中的报告是否有可能仅在 1 个测试失败时生成?

[英]Is any possible for the report in pytest-html to be generate only when 1 test is fail?

I got some tests to be executed and I want the report to be generated only if 1 of the tests are fail, right now I use this command:我要执行一些测试,并且我希望仅在其中 1 个测试失败时生成报告,现在我使用以下命令:

pytest -v -s --html=report.html --self-contained-html --capture=tee-sys  -rx --verbose --maxfail=6  testCases/test_signup_0.py

but this command generates a report for passing tests too.但是这个命令也会生成一个通过测试的报告。

I tried to add --lf(list fails) but this command test only the fails tests.我试图添加 --lf(list failed) 但这个命令只测试失败的测试。

Thank you in advance!先感谢您!

From GitHub pytest-html discussion is not possible to that, this features will be added从 GitHub pytest-html 讨论是不可能的,这个功能将被添加在此处输入图像描述 in the 4.x version在 4.x 版本中

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

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