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

A completely unexecuted file shows 14% coverage #156

Closed
nedbat opened this issue Nov 1, 2011 · 2 comments
Closed

A completely unexecuted file shows 14% coverage #156

nedbat opened this issue Nov 1, 2011 · 2 comments
Labels
branch bug Something isn't working

Comments

@nedbat
Copy link
Owner

nedbat commented Nov 1, 2011

A file with 50 statements and 8 branches, but completely unexecuted, shows as 14% covered. The results code decides that there are no unexecuted branches (because no statements were executed), and comes up with 8 executed branches.


@nedbat
Copy link
Owner Author

nedbat commented Apr 5, 2012

Original comment by Anonymous


I am seeing this same issue. Had upgraded from 3.4 to 3.5.1 and started seeing this (was working at 3.4). Took a look a the diffs in the code files. Found this change to results.py:

40c44,46
< n_missing_branches = sum([len(v) for v in mba.values()])

        n_missing_branches = sum(
            [len(v) for k,v in mba.items() if k not in self.missing]

Seems like this may be the cause ... why would you not count a branch if it was also in the missing statement list? Have to admit I'm a bit over my head trying to analyze the code, but if I revert this change, it seems like I get accurate branch analysis results.

@nedbat nedbat closed this as completed Nov 20, 2012
@nedbat
Copy link
Owner Author

nedbat commented Nov 20, 2012

Fixed in <<changeset cbe93a0d585f (bb)>>. Your branch coverage numbers will be lower... :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
branch bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant