1

我正在尝试删除 pytest-html 报告中存在的环境表,但我不知道该怎么做?

我已附上 pytest-html 报告 在此处输入图像描述

4

1 回答 1

5

文档中的相关位置指出:

Environment 部分由 pytest-metadata, 插件提供,可以通过pytest_configure钩子访问:

def pytest_configure(config):
    config._metadata['foo'] = 'bar'

修改config._metadata将影响呈现的“环境”部分。如果要完全删除它,请将元数据设置为None

# conftest.py

def pytest_configure(config):
    config._metadata = None
于 2018-06-06T09:57:16.980 回答