1. Ned Batchelder
  2. coverage.py
Issue #11 resolved

HTML report does not report on all code units

fniessink
created an issue

The HTML report does not report on code units that are not relative to the invoked script.

This is inconvenient in the following setup:

{{{ src/ src/whatever.py tests/ tests/my_testrunner.py tests/some_unittest_invoked_by_testrunner.py }}}

Invoking coverage as follows generates a coverage HTML report that does not include whatever.py:

cd tests; rm .coverage; coverage -x my_testrunner.py; coverage -b -d coverage.out

Invoking coverage as follows generates a coverage text report that does include whatever.py:

cd tests; rm .coverage; coverage -x my_testrunner.py; coverage -r

Removing the lines in report.py:Reporter.report_files() that skip code_units that are not relative fixes the issue for me. See attached patch.