Skip to content

continue marked as not covered #198

Closed
@nedbat

Description

@nedbat

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


Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingnot our bugThe problem was elsewhererun

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions