我知道如何使用(config._metadata = None)删除pytest-html报告中的整个“环境表”,但是有没有方法从该表中删除某些字段?我也可以使用(config._metadata‘’Python‘= '3+')更新某些字段的值,但找不到从html报告中删除字段的方法。
发布于 2021-03-15 23:46:02
如果要移除开头的字段,请在conftest.py中使用此挂钩
def pytest_configure(config):
config._metadata.pop("Platform")
config._metadata.pop("Plugins")否则,如果在测试会话结束时您想要移除,那么
@pytest.hookimpl(tryfirst=True)
def pytest_sessionfinish(session, exitstatus):
session.config._metadata.pop("JAVA_HOME")https://stackoverflow.com/questions/60293705
复制相似问题