Skip to content

fix: Keep HttpResponse isinstance checks from consuming streamed responses - #1010

Open
vdusek wants to merge 1 commit into
fix-try-import-maskingfrom
fix-http-response-protocol
Open

fix: Keep HttpResponse isinstance checks from consuming streamed responses#1010
vdusek wants to merge 1 commit into
fix-try-import-maskingfrom
fix-http-response-protocol

Conversation

@vdusek

@vdusek vdusek commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

HttpResponse now comes from typing_extensions, whose runtime protocol check looks attributes up statically. The typing implementation on Python 3.11 calls hasattr, which evaluates properties, so isinstance(response, HttpResponse) on an unread streaming response either raised or silently buffered the whole body.

Adds streaming regression tests (unit and integration) and a parametrized built-in-client fixture they run on.

Split out of #1006. Stacked on #1009.

✍️ Drafted by Claude Code

@vdusek vdusek added adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team. labels Aug 17, 2026
@vdusek vdusek self-assigned this Aug 17, 2026
@codecov

codecov Bot commented Aug 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.87%. Comparing base (e38c0b5) to head (df8a08d).

Additional details and impacted files
@@                    Coverage Diff                     @@
##           fix-try-import-masking    #1010      +/-   ##
==========================================================
- Coverage                   94.89%   94.87%   -0.02%     
==========================================================
  Files                          58       58              
  Lines                        5366     5367       +1     
==========================================================
  Hits                         5092     5092              
- Misses                        274      275       +1     
Flag Coverage Δ
integration 92.23% <100.00%> (-0.08%) ⬇️
unit 85.14% <100.00%> (+0.48%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@vdusek
vdusek requested a review from Pijukatel August 17, 2026 10:05
@vdusek
vdusek marked this pull request as ready for review August 17, 2026 10:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants