For the python coverage package, a missing else can be ignored for the resulting coverage by using # pragma: no branch.
It seems, that this is not working when breaking a long if statement in multiple lines like this:
if this_is_a_verylong_boolean_expression == True and another_long_expression \
    and here_another_expression:  # pragma: no branch
    do_something()
Is this a bug of coverage or intended behavior?
Is there a way to handle these kind of multiline statements and ignore the missing branch in the coverage? Or do I just have to accept the missing branches in my coverage summary?
I realize this is not exactly what you asked, but I would recommend that you refactor that line to not be so long. I would guess that the code will be much more readable and maintainable if you change it to:
some_condition = this_is_a_verylong_boolean_expression
another_test = another_long_expression
last_check = here_another_expression
if some_condition and another_test and last_check:     # pragma: no branch
    do_something()
This gives you a chance to give these expressions mnemonic names.
On the coverage.py question itself: you can make the pragma work like this:
if (this_is_a_verylong_boolean_expression == True and another_long_expression   # pragma: no branch
    and here_another_expression):
    do_something()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With