Executed line confusion

1 week ago 5
ARTICLE AD BOX

In the python program below:

1 a = 3
2
3 if a > 10:
4 print("gt10")
5 elif a > 5:
6 print("gt5 lt10")
7 elif a > 2:
8 print("bw25")
9 else:
10 pass

when I run formal code coverage tool SlipCover, when a is 3, the line 9 is not listed as missing line, but when it makes the previous conditionals evaluate to true such as a = 10, line 9 is listed as unexecuted line this time. I am really confused about this behaviour, in any case the body of else statement is not executed. Could you explain me the reason why else is in one case not listed as executed, but in the second case listed as unexecuted?

Read Entire Article