-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Doesn't work with httpx #46
Comments
rkhwaja
added a commit
to rkhwaja/wccls
that referenced
this issue
Oct 5, 2021
Hit a pytest-vcr bug? ktosiek/pytest-vcr#46
rkhwaja
added a commit
to rkhwaja/wccls
that referenced
this issue
Oct 21, 2021
Hit a pytest-vcr bug? ktosiek/pytest-vcr#46
rkhwaja
added a commit
to rkhwaja/wccls
that referenced
this issue
Dec 24, 2021
Hit a pytest-vcr bug? ktosiek/pytest-vcr#46
Monkey patch: from vcr.stubs import httpx_stubs
def _transform_headers(httpx_response):
out = {}
for key, var in httpx_response.headers.raw:
decoded_key = key.decode('utf-8')
decoded_var = var.decode('utf-8')
if decoded_key.lower() == 'content-encoding' and decoded_var in ('gzip', 'deflate'):
continue
out.setdefault(decoded_key, [])
out[decoded_key].append(decoded_var)
return out
httpx_stubs._transform_headers = _transform_headers See: kevin1024/vcrpy#591 and kevin1024/vcrpy#649 |
adamantike
added a commit
to rommapp/romm
that referenced
this issue
Jul 24, 2024
`pytest-vcr` [1] is no longer maintained (last commit was in 2020), and `VCR.py` recommends [2] `pytest-recording` instead. Also, `pytest-vcr` does not correctly support `httpx` [3]. This change also removes unused cassettes. [1] https://github.com/ktosiek/pytest-vcr [2] https://vcrpy.readthedocs.io/en/latest/usage.html#pytest-integration [3] ktosiek/pytest-vcr#46
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm not sure whether this package is expected to work with httpx but I'm getting the following error when recording a new cassette with decode_compressed_response=True:
The text was updated successfully, but these errors were encountered: