Skip to content

fix(aiohttp): Record error responses when raise_for_status is used#925

Open
andrescollares wants to merge 5 commits into
kevin1024:masterfrom
andrescollares:aiohttp-fix-raise-for-status-request-recording
Open

fix(aiohttp): Record error responses when raise_for_status is used#925
andrescollares wants to merge 5 commits into
kevin1024:masterfrom
andrescollares:aiohttp-fix-raise-for-status-request-recording

Conversation

@andrescollares

@andrescollares andrescollares commented Jun 12, 2025

Copy link
Copy Markdown
Collaborator

Fixes #635

Could be a breaking change for those that are using vcrpy with aiohttp and are expecting the library to not record error responses.

@JForsythe99 JForsythe99 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was in the process of writing a fix for this issue myself but just saw that you've already submitted this PR. Looks good to me - I've made a minor refactoring suggestion on your aiohttp stubs code but am happy with your change :)

Comment thread vcr/stubs/aiohttp_stubs.py
@andrescollares andrescollares force-pushed the aiohttp-fix-raise-for-status-request-recording branch from ea80ee9 to a3b94d8 Compare January 8, 2026 14:56
@andrescollares andrescollares force-pushed the aiohttp-fix-raise-for-status-request-recording branch from a3b94d8 to 2312d4b Compare June 22, 2026 15:55
@andrescollares

andrescollares commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator Author

I've been using this branch for a year now and I haven't found any issues with it yet, so I hope someone else can benefit from these changes after merging.

@andrescollares andrescollares added bug aiohttp issues related to aiohttp library and removed bug aiohttp issues related to aiohttp library labels Jun 22, 2026
@codecov-commenter

codecov-commenter commented Jun 22, 2026

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 89.47368% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.44%. Comparing base (06758c9) to head (b593fea).
⚠️ Report is 13 commits behind head on master.

Files with missing lines Patch % Lines
vcr/stubs/aiohttp_stubs.py 89.47% 1 Missing and 1 partial ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #925      +/-   ##
==========================================
- Coverage   92.71%   92.44%   -0.28%     
==========================================
  Files          27       27              
  Lines        1950     1999      +49     
  Branches      251      258       +7     
==========================================
+ Hits         1808     1848      +40     
- Misses         93       99       +6     
- Partials       49       52       +3     

☔ 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.

@JForsythe99 JForsythe99 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, will probably start using this myself

@andrescollares

Copy link
Copy Markdown
Collaborator Author

Hey @kevin1024 sorry for the tag, I have merge rights but this would be my first PR and it feels weird to just merge it without asking 😬.

@kevin1024

Copy link
Copy Markdown
Owner

Merge at will. But we will need to remember to do a major version bump since this is backwards incompatible

@andrescollares

Copy link
Copy Markdown
Collaborator Author

In that case, do you think it could be a good idea for me to solve a couple more issues that are backwards incompatible? that way maybe we can then release them all together in a single major version bump.

I went through the opened PRs and issues and grabbed some, if you have something that I could help with let me know, in the meantime I'll try to continue with some other aiohttp ones.

@kevin1024

Copy link
Copy Markdown
Owner

Sure, we can bundle some together. Thanks for helping. If there are any “greatest hits” tickets with a zillion comments or thumbs up those would be good ones.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

aiohttp and raise_for_status, unexpected behaviours

4 participants