nicoddemus / pytest-rich

pytest + rich integration (proof of concept)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add installed plugin information to report header

joshuadavidthomas opened this issue · comments

Currently, pytest-rich does not display any information about the plugins installed in the test environment.

Implementation from pytest's default TerminalReporter (link to source code):

def pytest_report_header(self, config: Config) -> List[str]:
    line = "rootdir: %s" % config.rootpath

    if config.inipath:
        line += ", configfile: " + bestrelpath(config.rootpath, config.inipath)

    testpaths: List[str] = config.getini("testpaths")
    if config.invocation_params.dir == config.rootpath and config.args == testpaths:
        line += ", testpaths: {}".format(", ".join(testpaths))

    result = [line]

>   plugininfo = config.pluginmanager.list_plugin_distinfo()
>   if plugininfo:
>       result.append("plugins: %s" % ", ".join(_plugin_nameversions(plugininfo)))
>   return result