Open asottile opened 1 year ago
That does indeed seem wrong. But tell me more about the pragma on line 8... if you don't expect line 8 to run, then how would line 10 run? Can you share the original code that led you down this path?
this branch was legitimately uncovered but was masked by a broken windows build https://github.com/pre-commit/pre-commit/blob/50c217964b0f00e38d67cac858b597501a86e22b/pre_commit/languages/rust.py#L99
when the build was fixed Linux had 100% coverage and windows was missing a branch -- but in reality the branch was not covered in either
Describe the bug
this was pretty tricky to narrow down -- initially I only found this through
covdefaults
and a particular branch which was conditionally ignored (only on windows) via thecovdefaults
-specific# pragma: win32 no cover
here's a case which reproduces without
covdefaults
:To Reproduce
I don't think this is version specific but here's my versions:
here's the output and commands:
I expect a missed branch from 7->exit, which is present if I remove the no cover: