kevin1024 / vcrpy

Automatically mock your HTTP interactions to simplify and speed up testing
MIT License
2.72k stars 388 forks source link

Fix streaming with httpx (fixes #597) #741

Closed parkerhancock closed 12 months ago

parkerhancock commented 1 year ago

Fixes #597 by having VCR work when the httpx streaming interface is used.

codecov-commenter commented 1 year ago

Codecov Report

Merging #741 (d6c25e4) into master (c95b726) will decrease coverage by 0.10%. The diff coverage is 100.00%.

:exclamation: Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@            Coverage Diff             @@
##           master     #741      +/-   ##
==========================================
- Coverage   90.63%   90.54%   -0.10%     
==========================================
  Files          28       28              
  Lines        1794     1798       +4     
  Branches      268      322      +54     
==========================================
+ Hits         1626     1628       +2     
- Misses        133      135       +2     
  Partials       35       35              
Impacted Files Coverage Δ
vcr/stubs/httpx_stubs.py 96.03% <100.00%> (-1.90%) :arrow_down:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

hartwork commented 1 year ago

@parkerhancock any news on the next iteration? I'd be happy to do review.

hartwork commented 1 year ago

@parkerhancock any news on the next iteration? I'd be happy to do review.

hartwork commented 1 year ago

@parkerhancock any news on the next iteration? I'd be happy to do review.

parkerhancock commented 1 year ago

Update here - I'm really stuck on this. For some reason, vcrpy "works" with the streaming interface (i.e. it caches something and returns something), but it only caches the first chunk, not the whole request. Not sure where to go from here.

parkerhancock commented 12 months ago

See #784, which fixes this and all other HTTPX issues.