Skip to content

Support method-level coverage in Cobertura XML files #2056

@thiagocrepaldi

Description

@thiagocrepaldi

As per an enlightening discussion with @nedbat on a Discord thread, coverage.py already reports on function and class coverages. This is achieved through HTML reports, in which we can see "Files, Functions, Classes" at the top of the index page.

However, the (Cobertura) XML report doesn't expose the same information. Instead, the coverage.py's xml report will show empty <methods/> entries

My feature request is to populate the the XML report with the function/methods coverage info. A sample XML on how the content should look like can be seen here

This feature would be helpful for rendering tools to easily report on/parse coverage information and possibly fail CI/CD runs when coverage is low for at the method-level coverage.

As a side note - but probably unrelated to the request, is that another project named fun-coverage implemented method-coverage on terminal-only.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions