Issue #156 resolved

A completely unexecuted file shows 14% coverage

Ned Batchelder
repo owner created an issue

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.

Comments (3)

  1. 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.

  2. Log in to comment