Skip to content

Migrate tests from aioresponses to aiointercept - #848

Merged
joostlek merged 1 commit into
mainfrom
claude/keen-faraday-grjw5s
Sep 19, 2026
Merged

joostlek merged 1 commit into
mainfrom
claude/keen-faraday-grjw5s

Conversation

@joostlek

Copy link
Copy Markdown
Owner

Proposed Changes

Migrate the test suite from aioresponses to aiointercept.

aioresponses constructs aiohttp.ClientResponse objects by hand. aiohttp 3.14 added a required keyword-only stream_writer argument to ClientResponse.__init__(), so aioresponses raises TypeError: ClientResponse.__init__() missing 1 required keyword-only argument: 'stream_writer' under aiohttp 3.14. aiointercept instead routes requests through a real aiohttp test server, is immune to this, supports aiohttp >= 3.13, and has a largely aioresponses-compatible API.

This unblocks the aiohttp 3.14 renovate upgrade (#812).

Changes:

  • pyproject.toml: replace aioresponses==0.7.9 with aiointercept==0.1.10 in the dev dependency group.
  • uv.lock: regenerated (aioresponses out, aiointercept in; no other deps changed).
  • tests/conftest.py: make the responses fixture async, using async with aiointercept(mock_external_urls=True) (the clients call hardcoded absolute URLs, so DNS-level interception is required). Dropped the now-unused Generator import.
  • tests/test_mealie.py: swap the aiointercept import and update all responses annotations. The CallbackResult callback, timeout, and assert_called* assertions all carry over unchanged.

Validated locally (Python 3.13): ruff check, mypy, and pytest (55 passed) all green. Also confirmed green with aiohttp==3.14.3 installed, proving the upgrade is unblocked.

Related Issues

Unblocks #812

🤖 Generated with Claude Code

https://claude.ai/code/session_01Jdau6PVn2yvwqncKwBKDZ4


Generated by Claude Code

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
@joostlek joostlek added the enhancement Enhancement of the code, not introducing new features. label Sep 19, 2026 — with Claude
@sonarqubecloud

Copy link
Copy Markdown

@joostlek
joostlek merged commit 4e8485c into main Sep 19, 2026
13 of 14 checks passed
@joostlek
joostlek deleted the claude/keen-faraday-grjw5s branch September 19, 2026 13:17
andrew-codechimp pushed a commit to andrew-codechimp/python-mealie that referenced this pull request Sep 19, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 20, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement Enhancement of the code, not introducing new features.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants