kevin1024 / vcrpy

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

Fix httpx support (select between allow_redirects/follow_redirects) #621

Closed immerrr closed 2 years ago

immerrr commented 3 years ago

This PR should fix the incompatibility introduced by the recent httpx release, when allow_redirects param was replaced with follow_redirects and default was changed from True to False.

immerrr commented 3 years ago

The CI build failed in my repo, due to what looks like a failure in pytest-httpbin:

https://github.com/immerrr/vcrpy/runs/4205197603?check_suite_focus=true#step:6:2872

I have submitted a PR to pytest-httpbin repo to fix this.

immerrr commented 3 years ago

I have submitted a temporary commit that points pytest-httpbin dependency to a branch in my repo with the fix:

https://github.com/immerrr/vcrpy/actions/runs/1459899288

codecov-commenter commented 3 years ago

Codecov Report

Merging #621 (bc2ce2e) into master (6e04003) will increase coverage by 0.57%. The diff coverage is 95.14%.

@@            Coverage Diff             @@
##           master     #621      +/-   ##
==========================================
+ Coverage   89.01%   89.59%   +0.57%     
==========================================
  Files          24       27       +3     
  Lines        1539     1730     +191     
  Branches      212      287      +75     
==========================================
+ Hits         1370     1550     +180     
- Misses        139      144       +5     
- Partials       30       36       +6     
Impacted Files Coverage Δ
vcr/stubs/__init__.py 92.48% <ø> (+1.05%) :arrow_up:
vcr/stubs/aiohttp_stubs.py 94.30% <88.05%> (ø)
vcr/stubs/httpx_stubs.py 97.93% <97.93%> (ø)
vcr/__init__.py 100.00% <100.00%> (ø)
vcr/cassette.py 96.20% <100.00%> (+0.03%) :arrow_up:
vcr/config.py 95.00% <100.00%> (+0.03%) :arrow_up:
vcr/filters.py 94.23% <100.00%> (+0.61%) :arrow_up:
vcr/patch.py 85.49% <100.00%> (+1.12%) :arrow_up:
vcr/record_mode.py 100.00% <100.00%> (ø)
vcr/serializers/jsonserializer.py 100.00% <100.00%> (ø)
... and 7 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 7d7164d...bc2ce2e. Read the comment docs.

immerrr commented 2 years ago

Thank you @jairhenrique