Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better class coverage reporting in xml? #158

Open
nedbat opened this issue Nov 9, 2011 · 1 comment
Open

Better class coverage reporting in xml? #158

nedbat opened this issue Nov 9, 2011 · 1 comment
Labels
enhancement New feature or request xml

Comments

@nedbat
Copy link
Owner

nedbat commented Nov 9, 2011

Originally reported by Anonymous


I'm running coverage (via django-jenkins, but that's irrelevant) and using the XML report with the cobertura plugin to generate reports. I have to say it's incredibly handy.

One niggle, though, is that the xml report treats the whole of a module as the source of a single "class" (so my coverage reports claim: "classes 1/1"). It looks from a very cursory glance that the parser is spotting the start of class definitions, but not necessarily their corresponding ends.

Does coverage.py currently gather enough information to (conceptually, at least) produce a class-by-class breakdown in the XML report? If not, what additional support in the parsing is going to be required to help make this work?

Cheers.


@nedbat
Copy link
Owner Author

nedbat commented Nov 9, 2011

The problem with trying to map the code to Cobertura more closely is that Cobertura is based on the structure of Java code, where every line of code is part of some class. In Python, there are functions and even just plain statements outside of classes. If we map Python classes onto Cobertura classes, then we have to figure out where to put the non-class code. And that's even before we get to the question of how to actually parse it all out.

Patches welcome! :-)

@nedbat nedbat added major enhancement New feature or request xml labels Jun 23, 2018
@nedbat nedbat removed the major label Jan 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request xml
Projects
None yet
Development

No branches or pull requests

1 participant