Closed
Description
Originally reported by Anonymous
It seems that if:
- there is an if statement with two predicates separated by an or operator
- the second (last?) predicate is not always "reached" (due to the fact that the first was always evaluated to True)
- inside the if, there is only a continue statement (or a pass followed by continue)
the continue statement is marked as missing which is not true. Especially in a "if True or True:" case.
continue.py:
#!python
for i in (1, 2, 3, 4):
if True or False:
continue # Missing
for i in (1, 2, 3, 4):
if False or True:
continue # Run
for i in (1, 2, 3, 4):
if True or True:
continue # Missing
for i in (1, 2, 3, 4):
if True or True:
print "test" # Run
continue # Run
print "End"
$ python --version
Python 2.7.2+
Run as:
$ coverage run continue.py && coverage html
- Bitbucket: https://bitbucket.org/ned/coveragepy/issue/198
- This issue had attachments: deadcode.py. See the original issue for details.