Repository navigation
Migrate tests from aioresponses to aiointercept - #848
Merged
Merged
Conversation
aioresponses builds aiohttp.ClientResponse objects by hand, which broke with aiohttp 3.14 (new required stream_writer kwarg). Replace it with aiointercept, which routes requests through a real aiohttp test server and supports aiohttp >= 3.13, unblocking the aiohttp 3.14 upgrade. Co-Authored-By: Claude Opus 4.8 <[email protected]> Claude-Session: https://claude.ai/code/session_01Jdau6PVn2yvwqncKwBKDZ4
|
andrew-codechimp
pushed a commit
to andrew-codechimp/python-mealie
that referenced
this pull request
Sep 19, 2026
Co-authored-by: Claude <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Proposed Changes
Migrate the test suite from
aioresponsestoaiointercept.aioresponsesconstructsaiohttp.ClientResponseobjects by hand. aiohttp 3.14 added a required keyword-onlystream_writerargument toClientResponse.__init__(), soaioresponsesraisesTypeError: ClientResponse.__init__() missing 1 required keyword-only argument: 'stream_writer'under aiohttp 3.14.aiointerceptinstead routes requests through a real aiohttp test server, is immune to this, supports aiohttp >= 3.13, and has a largelyaioresponses-compatible API.This unblocks the aiohttp 3.14 renovate upgrade (#812).
Changes:
pyproject.toml: replaceaioresponses==0.7.9withaiointercept==0.1.10in the dev dependency group.uv.lock: regenerated (aioresponses out, aiointercept in; no other deps changed).tests/conftest.py: make theresponsesfixture async, usingasync with aiointercept(mock_external_urls=True)(the clients call hardcoded absolute URLs, so DNS-level interception is required). Dropped the now-unusedGeneratorimport.tests/test_mealie.py: swap theaiointerceptimport and update allresponsesannotations. TheCallbackResultcallback, timeout, andassert_called*assertions all carry over unchanged.Validated locally (Python 3.13):
ruff check,mypy, andpytest(55 passed) all green. Also confirmed green withaiohttp==3.14.3installed, proving the upgrade is unblocked.Related Issues
Unblocks #812
🤖 Generated with Claude Code
https://claude.ai/code/session_01Jdau6PVn2yvwqncKwBKDZ4
Generated by Claude Code