Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Branch coverage failure continue in nested if statements #817

Closed
chrisrossi opened this issue Jun 28, 2019 · 2 comments
Closed

Branch coverage failure continue in nested if statements #817

chrisrossi opened this issue Jun 28, 2019 · 2 comments
Labels
bug Something isn't working

Comments

@chrisrossi
Copy link

This test case show missing branch coverage despite every branch being covered, AFAICT. The problem seems to be related to the continue statement and the nested if statements.

AFAICT, this is not a duplicate of #496 but may have a similar root cause.

def test_coverage_bug():
    did_something = False
    did_another_thing = False
    did_this_thing_first = False

    for i in range(5):
        if i > 0:
            if i < 5:
                if i % 2 == 0:
                    did_something = True
                else:
                    did_another_thing = True

                continue

        did_this_thing_first = True

    assert did_something
    assert did_another_thing
    assert did_this_thing_first
@nedbat
Copy link
Owner

nedbat commented Jun 29, 2019

I think this is a duplicate of #198, which unfortunately I can't do anything about.

@chrisrossi
Copy link
Author

Yes, that appears to be the case. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants