【发布时间】:2018-06-05 12:15:24
【问题描述】:
我正在尝试删除 pytest-html 报告中存在的环境表,但我不知道该怎么做?
我已附上 pytest-html 报告 enter image description here
【问题讨论】:
标签: python python-3.x pytest pytest-html
我正在尝试删除 pytest-html 报告中存在的环境表,但我不知道该怎么做?
我已附上 pytest-html 报告 enter image description here
【问题讨论】:
标签: python python-3.x pytest pytest-html
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
【讨论】: