Skip to content

Coverage XML report with sources argument turns root package name into period #613

@nedbat

Description

@nedbat

Originally reported by Nick Williams (Bitbucket: beamerblvd, GitHub: beamerblvd)


I filed this bug against pytest-cov, but I believe there is also a bug in Coverage that was revealed in my debugging of this code.

I won't copy the lengthy details and IPDB debugging output into here that can be read there. I'll just post the Coverage-specific problem here.

Essentially, calling coverage xml from the command line doesn't allow you to pass in sources, so this problem doesn't reveal itself through normal usage. However, when you call Coverage.xml_report from code (such as when integrating with pytest-cov, etc.), you are allowed to supply sources, and when doing so, the top-level package name in the XML report becomes a period (.) instead of the actual package name. I'm not sure what the correct behavior is if sources is passed in (or if that should be an error / not even an option in the XML reporter), but surely turning the top level package name into a period is not the correct behavior. :-)


Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingxml

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions