yield lambda branch coverage · Issue #308 · nedbat/coveragepy (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

@nedbat

Description

@nedbat

Originally reported by rdn_ (Bitbucket: rdn_, GitHub: Unknown)


Version 3.7.1

coverage run --branch x.py

Missing branch:

def run(): for i in range(10): yield lambda: i # partial coverage missing jump to previous line

for f in run(): print f()

Missing branch # 2:

def run(): yield lambda: 100 # partial coverage missing jump to next line for i in range(10): yield lambda: i # partial coverage missing jump to previous line

for f in run(): print f()

Fully covered:

def run(): yield lambda: 100 # no branch miss

for f in run(): print f()

Wasn't sure if I was overlooking something, but given the 2nd case I think the problem is in coverage.py