Skip to content

fix(v2): tolerate responses without request_info - #167

Closed
bdraco wants to merge 1 commit into
mainfrom
tolerate-missing-request-info
Closed

bdraco wants to merge 1 commit into
mainfrom
tolerate-missing-request-info

Conversation

@bdraco

@bdraco bdraco commented Nov 30, 2026

Copy link
Copy Markdown
Member

Lets async_request_token work with response objects that have no request_info, such as Home Assistant's aiohttp test mock, so integration tests can mock the token endpoint.

-                request_info = response.request_info
+                # Test doubles such as Home Assistant's aiohttp mock omit it.
+                request_info = getattr(response, "request_info", None)
  • Real aiohttp responses always have request_info, so production behaviour is unchanged. Without it, errors carry request_info=None, which the README's mapping already treats as a connection error.
  • Found while porting Move SolarEdge to the Basic Monitoring V2 API home-assistant/core#188074 to the new API: 27 of its tests failed on AiohttpClientMockResponse. With this change all 211 pass.
  • Its fix: title releases 1.1.2.

@codecov

codecov Bot commented Nov 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@bdraco bdraco closed this Nov 30, 2026
@bdraco
bdraco deleted the tolerate-missing-request-info branch November 30, 2026 22:50
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.

1 participant