Repository navigation
ci: Run lenient mypy on tests - #8316
Merged
Merged
Conversation
Run mypy over tests in addition to sentry_sdk. Tests are checked leniently: only module-level code and annotated functions, with missing third-party imports allowed, since most integration test dependencies aren't installed in the typing environment. Fix the errors this surfaced, including a wrong error sampler signature in test_client, a missing importlib.util import in test_quart, a dead Python 2 branch, and invalid type comments.
Contributor
Coverage Results 📊✅ 59170 passed | ⏭️ 3091 skipped | Total: 62261 | Pass Rate: 95.04% | Execution Time: 158m 31s 📊 Comparison with Base Branch
All tests are passing successfully. ✅ Patch coverage is 100.00% (no changed executable lines found; target 80%). Coverage diff@@ Coverage Diff @@
## master #8316 +/-##
==========================================
- Coverage 90.21% 90.11% -0.10%
==========================================
Files 203 200 -3
Tracked lines 27330 22081 -5249
Branches 10242 7738 -2504
==========================================
- Hits 24655 19898 -4757
+ Misses 2675 2183 -492
+ Partials 1558 1276 -282Generated by Coverage Action |
sentrivana
marked this pull request as ready for review
November 17, 2026 15:35
alexander-alderman-webb
approved these changes
Nov 17, 2026
alexander-alderman-webb
left a comment
Collaborator
There was a problem hiding this comment.
Awesome!
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.
Run mypy on tests.
This doesn't test much yet, but it's a first step.
Part of https://linear.app/getsentry/issue/PY-3084/add-meaningful-check-to-mypy