Py.Test : Reporting and HTML output

Dave picture Dave · Jul 9, 2013 · Viewed 26.5k times · Source

This is not a technical question at all really. However, I can not locate my .HTML report that is supposed to be generated using:

py.test --cov-report html pytest/01_smoke.py

I thought for sure it would place it in the parent location, or the test script location. Does neither and I have not been able to locate. So I am thinking it is not being generated at all?

Answer

hpk42 picture hpk42 · Jul 11, 2013

I think you also need to specify the directory/file you want coverage for like py.test --cov=MYPKG --cov-report=html after which a html/index.html is generated.