man*_*noj 1 python pytest python-3.x pytest-html
我正在尝试删除 pytest-html 报告中存在的环境表,但我不知道该怎么做?
我附上了 pytest-html 报告 在这里输入图像描述
Environment 部分由 pytest-metadata 插件提供,可以通过
pytest_configure钩子访问:Run Code Online (Sandbox Code Playgroud)def pytest_configure(config): config._metadata['foo'] = 'bar'
修改config._metadata将影响渲染的“环境”部分。如果要完全删除它,请将元数据设置为None:
# conftest.py
def pytest_configure(config):
    config._metadata = None