是否有一种方法可以在pytest生成的html报告中包含取消选择的测试,类似于跳过的测试?
生成的html文件: file://///////reports/report.html - ================ 13通过,41次跳过,6次在35.54s =================中被取消选举
我找到了一个在终端中打印它们的解决方案,将其添加到conftest.py中。
def pytest_deselected(items):
if not items:
return
config = items[0].session.config
reporter = config.pluginmanager.getplugin("terminalreporter")
reporter.ensure_newline()
for item in items:
reporter.line(f"deselected: {item.nodeid}", yellow=True, bold=True)但不知道如何在报告中列出这些测试

发布于 2020-08-06 15:47:16
最后,我将它们标记为跳过,而不是取消它们的选择,这样它们就很容易在报告中列出。
https://stackoverflow.com/questions/63256981
复制相似问题