-
Notifications
You must be signed in to change notification settings - Fork 390
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
Fix: Httpx Human Readable Responses #788
Conversation
make cassettes human readable
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #788 +/- ##
==========================================
+ Coverage 90.10% 90.13% +0.03%
==========================================
Files 27 27
Lines 1809 1815 +6
Branches 335 336 +1
==========================================
+ Hits 1630 1636 +6
Misses 134 134
Partials 45 45 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@parkerhancock please, rebase with master! |
Merge branch 'kevin1024:master' into httpx_content_types
@parkerhancock can you fix lint errors!? |
Hey! Just tried to. Ruff on my computer doesn't show any errors. Not sure what to do here.. |
Hi @parkerhancock, are you running the same version as CI: ruff 0.1.7? It says:
(at https://github.com/kevin1024/vcrpy/actions/runs/7183525284/job/19562496307?pr=788#step:5:9). The other issue looks like a flaky thing and should go away after re-running so ruff is likely our main and only thing to address here. |
@parkerhancock that just got proven correct be rerunning the CI. @jairhenrique I'm using pre-commit to run the same checks for local commits and in CI at multiple places and it would be the perfect fit for our use of ruff and make sure everyone is on the same version as a side-effect. Is that a direction that you would support in general? I can make a pull request about it but I'd want to be sure to not waste my time. Here's what I'm using with git-delete-merged-branches for example:
What do you think? |
@jairhenrique PS: In any case the CI should invoke ruff in a way where we can see a diff of the changes produced, using |
@hartwork personally I don't like pre-commit because it is a tool that can be bypassed with git's We can add ruff parameters that show a diff on errors. |
@parkerhancock i run, |
@jairhenrique I think there is a misunderstanding here: the CI still enforces ruff, it just uses pre-commit to do that — command |
@hartwork feel free to open a pr with pre-commit feature! About this pr, do you think we can merge? |
@jairhenrique alright, it will take a few minutes, probably before 20:00 UTC+1 though.
I haven't looked into httpx integration here at all yet, I would want leave that topic to the two of you for now. |
Little quality of life upgrade for #784 and httpx support. We fixed a lot of the functional issues by forcing a binary content type on all files regardless of mime type. But that makes the bodies not human readable in the cassettes, which is one of the big advantages of using VCRpy. This fixes it by attempting to convert all response bodies to text using utf-8, and if it fails to do so, then records binary content.
In no circumstance should this optional encoding of response bodies change the actual data coming to or from the client.
Test coverage also included!