pytest-html icon indicating copy to clipboard operation
pytest-html copied to clipboard

how to set pytest-cov output to a single html?

Open Jiangshan00001 opened this issue 5 years ago • 5 comments

how to set pytest-cov output to a single html? I'm trying to set the pytest-cov output to pytest-html, but don't know how to do. could you give me some advice?

Jiangshan00001 avatar Jan 04 '19 05:01 Jiangshan00001

Hi, unfortunatly I think that is not possible right now (unless @davehunt thinks otherwise). Pytest-HTML and Pytest-Cov could be integrated but I don't see it as an easy task, it could take some weeks, even months to do so.

RibeiroAna avatar Jan 04 '19 09:01 RibeiroAna

@RibeiroAna i see. thanks

Jiangshan00001 avatar Jan 04 '19 10:01 Jiangshan00001

I'm not familiar with pytest-cov, but pytest-html does have some hooks available for augmenting the report. If you're able to get the content from pytest-cov then it's possible you may find a way to create a single report. See the readme for details of the hooks provided. If you find you need new hooks, please open a new issue with details.

We could leave this issue open for a while to see if anyone familiar with pytest-cov has suggestions for how the two HTML reports could be combined.

davehunt avatar Jan 04 '19 10:01 davehunt

@ionelmc do you have anything to say about that?

RibeiroAna avatar Feb 03 '19 22:02 RibeiroAna

What would you want to see in pytest-html's output? Just the coverage report?

One of the plugins could have a hook that the other can use for copying the coverage report, or pytest-html could just override pytest_terminal_summary to capture pytest-cov's output.

If that's too much then pytest-cov could implement a pytestcov_write_summary hook that pytest-html can override to put the report both in terminal and html.

ionelmc avatar Feb 04 '19 07:02 ionelmc