Skip to content

HTML report does not report on all code units #11

@nedbat

Description

@nedbat

Originally reported by fniessink (Bitbucket: fniessink, GitHub: fniessink)


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.


Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions