Search code examples
pythonpython-3.xpytestpytest-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?

i have attached the pytest-html report enter image description here


Solution

  • 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:

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

    Modifying the config._metadata will effect the rendered "Environment" section. If you want to remove it completely, set the metadata to None:

    # conftest.py
    
    def pytest_configure(config):
        config._metadata = None