-
-
Notifications
You must be signed in to change notification settings - Fork 436
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
Multiline asserts need too many pragma: no covers #461
Comments
@warsaw can you provide a complete runnable example? Is the statement not covered because of -O? |
This was my attempt to reproduce it:
Here only line 2 is considered a statement, and a single pragma was enough to quiet it. |
Original comment by Barry Warsaw (Bitbucket: warsaw, GitHub: warsaw) That's interesting. In my larger test case, I'm not running with -O, and it seems like all four lines in the assert are being counted (and thus all four need pragma: no cover). I'll have to see if I can boil down to a smaller reproducible test case. |
If it doesn't reduce down, you can give me instructions how to run the larger test case. |
Original comment by Barry Warsaw (Bitbucket: warsaw, GitHub: warsaw) Hi Ned, thanks for the help. You should be able to reproduce like so:
You might have to change There are several cases where multiline asserts are being treated as multiple statements and being reported as not covered. |
OK, I've reproduced your results in your repo, thanks. Now to figure out why it's different than my test case.... |
Turns out this is another instance of http://bugs.python.org/issue19035: form-feeds look like end-of-file. @warsaw is it possible you are the only person still using form-feeds? :) :) I'll make a fix soon. |
Fixed in b3a775b34648 (bb), which will be in 4.1. |
Originally reported by Barry Warsaw (Bitbucket: warsaw, GitHub: warsaw)
Code like the following:
Note the
pragma: no cover
on every line. I want to completely ignore the entire assert statement, but w/o all those pragmas, I get a report that some of those lines aren't covered, which is true, but unhelpful!The text was updated successfully, but these errors were encountered: