1. Ned Batchelder
  2. coverage.py
Issue #308 resolved

yield lambda branch coverage

rdn_
created an issue

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

Comments (3)

  1. Log in to comment