Issue #292 new

Mark partially evaluated if conditions are not covered

Marc Schlaich
created an issue

This is a follow up from my comment in #198.

Consider the case:

def test(a, b):
    if a or b:
        print 1

If you run this it counts as covered if either a or b is True. But I think for a fully covered test you should consider both cases (True, False) and (False, True) before it is actually correctly covered. b could be a complicated statement which is never checked in unit tests even if this line has code coverage. Even a bug would get 100% coverage:

def test(a, b):
    if a or failing_statement:
        print 1

Comments (3)

  1. Marc Schlaich reporter

    Just to be clear, this should be something between normal and branch coverage. In the example testing against (True, False) and (False, True) should be sufficient.

  2. Log in to comment