pragma no cover fails with elif · Issue #697 · nedbat/coveragepy (original) (raw)

Hi Ned, et al.,
Following https://coverage.readthedocs.io/en/coverage-4.3.4/excluding.html#branch-coverage, I expect

    def test(self):
        if False:
            pass    # 1
        elif True:  # 2
            pass
        else:    # pragma no cover
            pass    # 3
        pass # 4

to not report that branch at # 2 fails to branch to the else. This works in the above example, but in a piece of production code it reports that the branch at # 2 fails to go to #4 instead:
failed no cover

unfortunately, I don't know how to reproduce this in a minimal snippet.

thanks
Arthur