This rather simple code has 89% coverage, because coverage in branch mode thinks that line 5 never exits the module.
import sys if sys.argv == 'a': print("A") elif sys.argv == 'b': print("B")
Steps to reproduce:
coverage run --branch foo.py a coverage run -a --branch foo.py b
To get 100% coverage: append one more run, this time with
c (or anything other than
b) as its argument.
Reproducible in 4.0.3 and 4.1 (from hg)