Incomplete Branch Coverage in Try/Except Block

Issue #384 duplicate
Lasse Schuirmann created an issue

Hi,

we're getting an incomplete branch coverage for this situation: https://codecov.io/github/coala-analyzer/coala/coalib/output/ConsoleInteraction.py?ref=6c9d09081ee841a15363edef17f8b8ff252dc674#l-88

So obviously coverage wants us to test the exception. However, we're doing that with an ugly whitebox test overwriting the open builtin. I don't really see how we miss a jump here and others in the team are also out of clues, can you provide any insight? This looks like a bug to me.

(Note: this issue is not specific to codecov and also occurs locally.)

Here's the code of this very state: https://github.com/coala-analyzer/coala/tree/6c9d09081ee841a15363edef17f8b8ff252dc674

You can execute tests locally to reproduce with ./run_tests.py -c.

We're happy to provide any additional information needed.

Comments (4)

  1. Lasse Schuirmann reporter

    or to make it simpler: here's instructions to reproduce

    git clone https://github.com/coala-analyzer/coala/
    cd coala
    git checkout 6c9d09081ee841a15363edef17f8b8ff252dc674
    ./run_tests.py -H  # -c generates coverage, -H generates HTML and opens in browser
    
  2. Log in to comment