Hi all,

I've just released Coverage.py 4.1 beta 1: 
http://nedbatchelder.com/blog/201601/coveragepy_41b1.html

It has a new branch analysis implementation, partly to deal with the async 
keyword.  But I need some help deciding how it should work with the new 
features.

A yield-from statement is possibly an exit from the function, as it yields 
values.  If you use a yield-from, and no values are yielded, coverage.py 
4.1b1 will mark it as partially uncovered because the branch to the 
function exit isn't taken.  But yield-from is also used to call functions 
that won't produce a value.  So we have a choice: Should coverage.py could 
insist on a branch to the function exit?  Pro: this could alert you to code 
you thought produced values, but doesn't.  Con: the places you know you 
aren't getting any values, you'll have to use a pragma comment to shut up 
coverage.py.

What would you prefer?

My understanding is that "await" behaves the same, so I'm assuming the same 
decision would apply there.  BTW: the 4.1b1 code is definitely wrong in 
that it doesn't grok the difference between "yield from x" and "v = yield 
from x".  The latter is clearly not a function exit, but 4.1b1 also insists 
that it should branch to the function exit, which it never will, so at the 
very least that has to get fixed.

Any other thoughts about what's needed are also welcome.  Thanks,

--Ned.

Reply via email to