【问题标题】:How to remove skipped tests from html report如何从 html 报告中删除跳过的测试
【发布时间】:2020-12-28 20:55:37
【问题描述】:

我正在使用 pytest 进行自动化。我有很多测试用例,并且有一个测试用例作为跳过测试,如下所示,

def test_step(index, description):
"""
    Logs the start of a test step.
"""
    # code for print log

现在,当我执行任何测试文件并生成报告时,此 test_step 也被视为报告中跳过的测试用例。

如何从 html 报告中删除跳过的测试用例?

【问题讨论】:

    标签: python-3.x testing automation pytest qa


    【解决方案1】:

    通过使用它,我可以忽略 html 报告中跳过的测试,

    def pytest_html_results_table_row(report, cells):
        if report.skipped:
          del cells[:]
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-04-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-07-26
      相关资源
      最近更新 更多