-2

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

Vitalii Ponomar
  • 10,686
  • 20
  • 60
  • 88
  • Sorry, I don't understand your screenshot, like, at all. You should very likely explain what we're looking at, and what the colors mean – Marcus Müller Jun 20 '17 at 08:38
  • Neither do i. What do you mean with How? What do they do? In which conditions are executable? – Ivan Jun 20 '17 at 08:39
  • what's even the question? Python: Do you speak it? – Marcus Müller Jun 20 '17 at 08:39
  • @MarcusMüller You are looking at code coverage. In green, lines that are executed, in red those who are not. – Nuageux Jun 20 '17 at 08:39
  • 2
    You should delete the old coverage results, usually in `.coverage`. – Klaus D. Jun 20 '17 at 08:40
  • Well, if the tool can rule out `dt_local is None`, then obviously, all places from which that function is called don't have that condition, so obviously, OP isn't posting enough of the code. So, this question remains absolutely unclear (VTC)! Other option: The coverage testing tool doesn't work as intended, in whcih case: we should vote to close as non-reproducible. – Marcus Müller Jun 20 '17 at 08:40
  • @KlausD. Yes, you was right. Thank you! Create an usual answer and I will accept it. – Vitalii Ponomar Jun 20 '17 at 08:43

1 Answers1

2

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.

Klaus D.
  • 13,874
  • 5
  • 41
  • 48