如何删除 pytest-html 报告中的环境 table
How to remove environment table in the pytest-html report
我正在尝试删除 pytest-html 报告中存在的环境 table,但我不确定该怎么做?
我附上了 pytest-html 报告
enter image description here
The Environment section is provided by the pytest-metadata, plugin, and can be accessed via the pytest_configure
hook:
def pytest_configure(config):
config._metadata['foo'] = 'bar'
修改 config._metadata
将影响呈现的“环境”部分。如果要完全删除它,请将元数据设置为 None
:
# conftest.py
def pytest_configure(config):
config._metadata = None
我正在尝试删除 pytest-html 报告中存在的环境 table,但我不确定该怎么做?
我附上了 pytest-html 报告 enter image description here
The Environment section is provided by the pytest-metadata, plugin, and can be accessed via the
pytest_configure
hook:def pytest_configure(config): config._metadata['foo'] = 'bar'
修改 config._metadata
将影响呈现的“环境”部分。如果要完全删除它,请将元数据设置为 None
:
# conftest.py
def pytest_configure(config):
config._metadata = None