feat(tests): Do not include type checking code in coverage report#3327
Merged
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## master #3327 +/- ##
==========================================
+ Coverage 79.49% 79.75% +0.25%
==========================================
Files 133 133
Lines 14307 14285 -22
Branches 3009 3001 -8
==========================================
+ Hits 11374 11393 +19
+ Misses 2089 2070 -19
+ Partials 844 822 -22 |
sentrivana
approved these changes
Jul 23, 2024
Contributor
sentrivana
left a comment
There was a problem hiding this comment.
Nice! Didn't know this was possible.
| [tool.coverage.report] | ||
| exclude_also = [ | ||
| "if TYPE_CHECKING:", | ||
| ] No newline at end of file |
Member
There was a problem hiding this comment.
Please add newline at the end of the file here
szokeasaurusrex
approved these changes
Jul 23, 2024
Member
szokeasaurusrex
left a comment
There was a problem hiding this comment.
Thanks for this change, I hope it helps us get more accurate coverage reports!
arjennienhuis
pushed a commit
to arjennienhuis/sentry-python
that referenced
this pull request
Sep 30, 2024
…tsentry#3327) This should not count lines (or rather if blocks) that start with if TYPE_CHECKING in the code coverage report, because this code is only evaluated when checking types with mypy.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This should not count lines (or rather if blocks) that start with
if TYPE_CHECKINGin the code coverage report, because this code is only evaluated when checking types with mypy.