I don't quite understand what Python's branch coverage stats are trying to tell me. Given code of the form
def f(a, b):
c = (i for i in a)
d = (j for j in b) # Line of interest
return dict(zip(c, d))
print(f(['a', 'b'], [1, 2]))
which is imported during unit testing, Python's standard branch coverage tells me that the # Line of interest
line is only partially covered (n->-n
on the CLI output, "n ↛ exit [?]" in the pretty html report).
The returned dict is clearly printed out, and executing with empty lists still yields the uncovered line.
Am I misinterpreting the coverage output? Does this smell like a bug?
Python 3.5.1, Coverage 4.0.3