Skip to content

test(httpx,httpx2): Split into sync/async tests - #7152

Merged
sentrivana merged 3 commits into
masterfrom
ivana/pytest-asyncio-in-httpx-tests
Aug 10, 2026
Merged

test(httpx,httpx2): Split into sync/async tests#7152
sentrivana merged 3 commits into
masterfrom
ivana/pytest-asyncio-in-httpx-tests

Conversation

@sentrivana

@sentrivana sentrivana commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Instead of parametrizing on sync/async httpx(2) client, split each test case into a sync and async variant, with the async variant as a proper async def function with @pytest.mark.parametrize.

I did this because the tests routinely fail for me locally, and switching to using pytest-asyncio fixes that. The other reason is that for #7149, the breadcrumb tests don't simulate async very well, which leads to some scope problems and ultimately breadcrumbs not appearing on events in tests.

I know this PR is not ideal since with the existing test duplication on span streaming/transaction tracing, we already have a LOT of test cases, and now many of them get an additional variant. But it does make them more resilient to random local (and I believe also CI) failures and we'll get rid of half of them on the new major branch.

@sentrivana sentrivana changed the title test(httpx): Split into sync/async tests test(httpx,httpx2): Split into sync/async tests Aug 10, 2026
@sentrivana
sentrivana marked this pull request as ready for review August 10, 2026 13:45
@sentrivana
sentrivana requested a review from a team as a code owner August 10, 2026 13:45
@github-actions

Copy link
Copy Markdown
Contributor

Codecov Results 📊

99884 passed | ⏭️ 6677 skipped | Total: 106561 | Pass Rate: 93.73% | Execution Time: 357m 22s

📊 Comparison with Base Branch

Metric Change
Total Tests
Passed Tests
Failed Tests
Skipped Tests

✨ No test changes detected

All tests are passing successfully.

✅ Patch coverage is 100.00%. Project has 2501 uncovered lines.
✅ Project coverage is 90.03%. Comparing base (base) to head (head).

Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    90.00%    90.03%    +0.03%
==========================================
  Files          193       193         —
  Lines        25089     25089         —
  Branches      9078      9078         —
==========================================
+ Hits         22581     22588        +7
- Misses        2508      2501        -7
- Partials      1439      1439         —

Generated by Codecov Action

@sentrivana
sentrivana merged commit 3fbf49b into master Aug 10, 2026
145 checks passed
@sentrivana
sentrivana deleted the ivana/pytest-asyncio-in-httpx-tests branch August 10, 2026 14:49
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