简体   繁体   English

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

[英]How to remove environment table in the pytest-html report

i am trying to remove environment table present in the pytest-html report ,but i am not sure how to do it? 我正在尝试删除pytest-html报告中存在的环境表,但是我不确定该怎么做?

i have attached the pytest-html report enter image description here 我已经附上pytest-html报告, 在此处输入图片描述

The relevant spot in the docs states: 文档中相关位置指出:

The Environment section is provided by the pytest-metadata, plugin, and can be accessed via the pytest_configure hook: “环境”部分由pytest-metadata插件提供,可以通过pytest_configure挂钩进行访问:

 def pytest_configure(config): config._metadata['foo'] = 'bar' 

Modifying the config._metadata will effect the rendered "Environment" section. 修改config._metadata将影响呈现的“环境”部分。 If you want to remove it completely, set the metadata to None : 如果要完全删除它,请将元数据设置为None

# conftest.py

def pytest_configure(config):
    config._metadata = None

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM