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
Exclude_lines unable to exclude entire if block from coverage.py in 5.5 version. #1756
Comments
Please provide a link to your code, there must be an error in it somewhere. Can you try using the latest version of coverage? Why are you using 5.5? |
I can upgrade to 7.4.4 latest version so it is that in coverage 5.5 version it cannot exclude entire if block ? |
It would be easier to help if you could give us a link to your whole repo. Can you at least show us the code that you wanted to exclude, but you weren't able to exclude? |
Hi @nedbat,I did upgrade coverage version from 5.5 to 7.4.4 but still same issue. Because of privacy concern I will not be able to share link. Below I have reproduced the issue(Pasted the same code)
And my coverage for if TYPE_CHECKING: block if TYPE_CHECKING: --covered
|
Thanks. I hate to nit-pick, but please fix the formatting in the comment, and show the commands you used to run coverage, and show the output of |
If you get more information, feel free to add it here, and I can re-open the issue. |
Have you asked elsewhere?
No
There are other good places to ask for help using coverage.py. These places let
other people suggest solutions, are more likely places for people to find your
question:
I am using exactly same thing as mentioned here #831 (comment) in my .coveragerc file but my report is not as expected showing uncovered for lines inside if block.But when I used pragma: no cover it was able to exclude entire if block but I need if condition: to be excluded in whole repository without using pragma: no cover in from of if block in codebase.
The text was updated successfully, but these errors were encountered: