3

The following post Py.Test : Reporting and HTML output outlines a way to submit py-test with html reports, but it doesnt work with pytest 2.6.1

The "--cov" and "--cov-report" options both fail for me.

Is there a way to generate HTML reports from pytest 2.6.1?

Community
  • 1
  • 1
jayunit100
  • 17,388
  • 22
  • 92
  • 167

3 Answers3

4

It would have been useful to show or describe how it fails. However note that coverage and thus these options are provided by the pytest-cov plugin which needs to be installed separately: https://pypi.python.org/pypi/pytest-cov

If that wasn't the problem then please update the question with more details.

flub
  • 5,953
  • 27
  • 24
4

pytest-html is a plugin for py.test that generates a HTML report for the test results. More info @ https://github.com/pytest-dev/pytest-html

Dave Hunt
  • 8,191
  • 4
  • 38
  • 39
0

This question is ok, but it make the google search result go here:

Below should work normally with Python from 2.7

pytest --cov-report=html ...

Refer more on: https://pytest-cov.readthedocs.io/en/latest/reporting.html

Phuong
  • 1,153
  • 1
  • 10
  • 17