如何从 Pytest-Html 报告中删除“环境”表

问题描述 投票:0回答:1

我在这个网站这里找到的以下代码没有任何效果。

建议设置metadata=None,但这没有效果。这是代码:

def pytest_configure(config):
    config._metadata = None

如何从 Pytest-Html 报告中删除环境表?

enter image description here

pytest pytest-html
1个回答
0
投票

您需要 pytest-metadata 插件。

from pytest_metadata.plugin import metadata_key


def pytest_configure(config):
    config.stash[metadata_key]["foo"] = "bar"
© www.soinside.com 2019 - 2024. All rights reserved.