如何从HTML报告中删除跳过的测试

问题描述

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

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

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

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

解决方法

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

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