如何删除pytest-html报告中的环境表

man*_*noj 1 python pytest python-3.x pytest-html

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

我附上了 pytest-html 报告 在这里输入图像描述

hoe*_*ing 5

文档中相关位置指出:

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

def pytest_configure(config):
    config._metadata['foo'] = 'bar'
Run Code Online (Sandbox Code Playgroud)

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

# conftest.py

def pytest_configure(config):
    config._metadata = None
Run Code Online (Sandbox Code Playgroud)