Skip to content

test: drop aiounittest in favor of stdlib IsolatedAsyncioTestCase#919

Open
sarteta wants to merge 1 commit intotwilio:mainfrom
sarteta:drop-aiounittest
Open

test: drop aiounittest in favor of stdlib IsolatedAsyncioTestCase#919
sarteta wants to merge 1 commit intotwilio:mainfrom
sarteta:drop-aiounittest

Conversation

@sarteta
Copy link
Copy Markdown

@sarteta sarteta commented Apr 21, 2026

Fixes #916.

aiounittest has had no release since 2022 and the maintainer has confirmed it won't get Python 3.14 support (kwarunek/aiounittest#28), which was blocking the test suite on 3.14.

Everything the test suite uses from aiounittest — specifically aiounittest.AsyncTestCase — has been in the stdlib since Python 3.8 as unittest.IsolatedAsyncioTestCase. The API is identical for our use: async def test_* methods + setUp/tearDown, no custom event-loop handling needed. So this is a straight import swap, no test-method changes.

Changes

  • tests/requirements.txt — remove aiounittest
  • tests/unit/http/test_async_http_client.py — 3 classes
  • tests/unit/rest/test_client.py — 1 class
  • tests/unit/base/test_version.py — 1 class

Local verification

Python 3.13 on Windows (3.14 not installed locally, but the substitution is a superset — IsolatedAsyncioTestCase works on 3.8+):

$ pytest tests/unit/
620 passed, 101 warnings in 7.02s

The 71 tests in the three touched files (TestAsyncHttpClientRequest, TestAsyncHttpClientRetries, TestAsyncHttpClientSession, TestClientAsyncRequest, AsyncVersionTestCase) all pass.

Fixes twilio#916. aiounittest hasn't had a release since 2022 and doesn't
support Python 3.14 (kwarunek/aiounittest#28), which was breaking the
test suite build on 3.14.

unittest.IsolatedAsyncioTestCase has been in the stdlib since Python 3.8
and is a drop-in replacement for aiounittest.AsyncTestCase, so this is
just an import swap.

Changes:
- tests/requirements.txt: remove aiounittest
- tests/unit/http/test_async_http_client.py
- tests/unit/rest/test_client.py
- tests/unit/base/test_version.py

Tested locally on Python 3.13 (Windows): 620 unit tests pass, including
the 71 previously-async tests in the three files touched.
@sarteta sarteta changed the title tests: drop aiounittest in favor of stdlib IsolatedAsyncioTestCase test: drop aiounittest in favor of stdlib IsolatedAsyncioTestCase Apr 21, 2026
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.

Drop aiounittest test dependency (broken on Python 3.14)

1 participant