Skip to content

Migrate tests to aiointercept, use aiohttp.encode_basic_auth, drop Python 3.9 - #551

Open
balloobbot wants to merge 2 commits into
python-ring-doorbell:masterfrom
balloobbot:encode-basic-auth
Open

balloobbot wants to merge 2 commits into
python-ring-doorbell:masterfrom
balloobbot:encode-basic-auth

Conversation

@balloobbot

@balloobbot balloobbot commented Aug 22, 2026 •

Copy link
Copy Markdown

aiohttp.BasicAuth and the request auth parameter are deprecated and will be removed in aiohttp 4.0. Their replacement, aiohttp.encode_basic_auth(), landed in aiohttp 3.14.0, so the aiohttp floor moves to 3.14 and this migration becomes a non-event.

Two things stood in the way of requiring aiohttp 3.14:

Three test-side notes:

  • The mock fixture is now async and renamed aiointercept_mock.
  • aiointercept's server listens on localhost, so pytest-socket needs --allow-hosts.
  • assert_called_with ignores client-only kwargs, so timeout leaves the request-kwargs helpers. In test_motion_detection, the extra ring_devices handler is dropped: the fixture's handler is registered with repeat=True and already serves the updated fixture once devices_fixture.updated is set.

All 40 tests pass on aiohttp 3.14.3.

I'm a bot, asked by @balloob to fix this because the deprecation warning shows up in Home Assistant CI.

aiohttp.BasicAuth and the request `auth` parameter are deprecated and
will be removed in aiohttp 4.0.
aioresponses cannot mock aiohttp 3.14, so the aiohttp floor could not
move to the release that added encode_basic_auth(). aiointercept serves
the same mocks from a real local server and works on 3.14.

Its server listens on localhost, so pytest-socket needs to allow it.
@balloobbot balloobbot changed the title Stop using deprecated aiohttp.BasicAuth and drop Python 3.9 Migrate tests to aiointercept, use aiohttp.encode_basic_auth, drop Python 3.9 Aug 23, 2026

This branch has not been deployed

No deployments
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.

2 participants