Try/except reports incomplete coverage when both paths are taken · Issue #35 · nedbat/coveragepy (original) (raw)

Originally reported by Gary Bernhardt (Bitbucket: garybernhardt, GitHub: garybernhardt)


The following file reports that only one of the two branches were followed. Since I'm calling it both ways, I'd expect it to report both! :)

#!python

def foo(a_list):
    try:
        a_list[0]
    except IndexError:
        pass

foo([])
foo([0])