Skip to content

feat: Support httpx2#6463

Merged
sentrivana merged 10 commits into
masterfrom
ivana/add-httpx2-integration
Jun 1, 2026
Merged

feat: Support httpx2#6463
sentrivana merged 10 commits into
masterfrom
ivana/add-httpx2-integration

Conversation

@sentrivana
Copy link
Copy Markdown
Contributor

@sentrivana sentrivana commented Jun 1, 2026

Description

Support httpx2.

Copy our httpx integration and tests and use that as the basis for the new integration, so that if the new fork diverges, we can only edit the dedicated integration.

Changes compared to HttpxIntegration:

  • Renamed all httpx -> httpx2 (duh)
  • Needed a replacement for pytest-httpx. Picked httpx2-pytest since it's drop-in. Since it's a new project, pinned it to the current version for additional safety.
  • The tests needed adapting to be 3.14 compatible (httpx isn't tested on 3.14): asyncio.get_event_loop().run_until_complete -> asyncio.run

Docs: getsentry/sentry-docs#17940

Issues

Reminders

@linear-code
Copy link
Copy Markdown

linear-code Bot commented Jun 1, 2026

PY-2502

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 1, 2026

Codecov Results 📊

7 passed | Total: 7 | Pass Rate: 100% | Execution Time: 1.20s

📊 Comparison with Base Branch

Metric Change
Total Tests 📉 -69
Passed Tests 📉 -69
Failed Tests
Skipped Tests

All tests are passing successfully.

✅ Patch coverage is 99.17%. Project has 16930 uncovered lines.
✅ Project coverage is 26.47%. Comparing base (base) to head (head).

Files with missing lines (1)
File Patch % Lines
sentry_sdk/integrations/httpx2.py 99.17% ⚠️ 1 Missing and 6 partials
Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    25.79%    26.47%    +0.68%
==========================================
  Files          190       191        +1
  Lines        22905     23025      +120
  Branches      7856      7902       +46
==========================================
+ Hits          5907      6095      +188
- Misses       16998     16930       -68
- Partials       544       554       +10

Generated by Codecov Action

Comment thread scripts/populate_tox/config.py Outdated
Comment thread sentry_sdk/integrations/httpx2.py
Comment thread tests/integrations/httpx2/test_httpx2.py
Comment thread tests/integrations/httpx2/__init__.py Outdated
Comment thread tests/integrations/httpx2/test_httpx2.py
@sentrivana sentrivana changed the title feat: Add support for httpx2 feat: Support httpx2 Jun 1, 2026
@sentrivana sentrivana marked this pull request as ready for review June 1, 2026 09:26
@sentrivana sentrivana requested a review from a team as a code owner June 1, 2026 09:26
Comment thread sentry_sdk/integrations/httpx2.py
Comment thread tests/integrations/httpx2/test_httpx2.py
@sentrivana sentrivana marked this pull request as draft June 1, 2026 09:43
@sentrivana sentrivana marked this pull request as ready for review June 1, 2026 09:49
@sentrivana sentrivana merged commit 25272c9 into master Jun 1, 2026
165 of 167 checks passed
@sentrivana sentrivana deleted the ivana/add-httpx2-integration branch June 1, 2026 10:04
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.

Add support for httpx2

2 participants