Search code examples
pythoncode-coveragenosecover

python cover: strange function coverage


Green color: code line is reachable.

Red color: code line is not reachable.

How could it be that lines 72, 74, 76 are reachable? enter image description here


Solution

  • The result of the coverage run are stored in .coverage and taken into account in later coverage runs. This might lead to weird results when the code has changed.

    To solve the problem, just delete .coverage and rerun.