Skip to content

ci: Run lenient mypy on tests - #8316

Merged
sentrivana merged 1 commit into
major/3.0from
ivana/typecheck-tests
Nov 17, 2026
Merged

sentrivana merged 1 commit into
major/3.0from
ivana/typecheck-tests

Conversation

@sentrivana

@sentrivana sentrivana commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

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

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.
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Coverage Results 📊

✅ 59170 passed | ⏭️ 3091 skipped | Total: 62261 | Pass Rate: 95.04% | Execution Time: 158m 31s

📊 Comparison with Base Branch

Metric Change
Total Tests 📉 -84841
Passed Tests 📉 -80075
Failed Tests —
Skipped Tests 📉 -4766

All tests are passing successfully.

✅ Patch coverage is 100.00% (no changed executable lines found; target 80%).
Project statement coverage is 90.11% (down 0.10 percentage points from base (2bb50dd) to head (6497000)).

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      -282

Generated by Coverage Action

@sentrivana sentrivana changed the title ci: Type check tests with mypy ci: Run lenient mypy on tests Nov 17, 2026
@sentrivana
sentrivana marked this pull request as ready for review November 17, 2026 15:35
@sentrivana
sentrivana requested a review from a team as a code owner November 17, 2026 15:35
@linear-code

linear-code Bot commented Nov 17, 2026

Copy link
Copy Markdown

PY-3084

@alexander-alderman-webb alexander-alderman-webb left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!

@sentrivana
sentrivana merged commit 3a9efc8 into major/3.0 Nov 17, 2026
301 of 303 checks passed
@sentrivana
sentrivana deleted the ivana/typecheck-tests branch November 17, 2026 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants