Skip to content

Drop aiounittest dependency, use stdlib IsolatedAsyncioTestCase#34

Merged
nielstron merged 2 commits intomainfrom
copilot/drop-aiounittest-test-dependency
Mar 23, 2026
Merged

Drop aiounittest dependency, use stdlib IsolatedAsyncioTestCase#34
nielstron merged 2 commits intomainfrom
copilot/drop-aiounittest-test-dependency

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 23, 2026

aiounittest is broken on Python 3.14 and unmaintained since 2022. Everything it provides has been available in unittest.IsolatedAsyncioTestCase since Python 3.8.

Changes

  • tests/util.py: Replace aiounittest.AsyncTestCase with unittest.IsolatedAsyncioTestCase; remove the now-unnecessary __getattribute__ override that manually dispatched async setUp/tearDown
  • tests/test_web_v0.py, tests/test_web_v1.py: Rename async def setUp/tearDownasync def asyncSetUp/asyncTearDownIsolatedAsyncioTestCase runs setUp/tearDown synchronously via contextvars.Context.run() and only awaits the asyncSetUp/asyncTearDown variants
  • pyproject.toml: Remove aiounittest>=1.5.0 from dev dependencies
  • uv.lock: Remove aiounittest package entry
# Before
class AsyncTestCaseSetup(aiounittest.AsyncTestCase):
    async def setUp(self): ...
    async def tearDown(self): ...
    def __getattribute__(self, name): ...  # manual async dispatch

# After
class AsyncTestCaseSetup(unittest.IsolatedAsyncioTestCase):
    async def asyncSetUp(self): ...
    async def asyncTearDown(self): ...
Original prompt

This section details on the original issue you should resolve

<issue_title>Drop aiounittest test dependency (broken on Python 3.14)</issue_title>
<issue_description>Home Assistant 2026.3 moved to Python 3.14, which means yalexs' test suite can't be built anymore. aiounittest doesn't support 3.14 and looks like it won't anytime soon (kwarunek/aiounittest#28, last release was 2022).

Everything aiounittest does has been in the stdlib since Python 3.8 via unittest.IsolatedAsyncioTestCase, so it should be a straightforward swap.
</issue_description>

Comments on the Issue (you are @copilot in this section)


📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.

Copilot AI changed the title [WIP] Remove aiounittest test dependency for Python 3.14 Drop aiounittest dependency, use stdlib IsolatedAsyncioTestCase Mar 23, 2026
Copilot AI requested a review from nielstron March 23, 2026 16:47
@nielstron nielstron marked this pull request as ready for review March 23, 2026 16:54
@nielstron
Copy link
Copy Markdown
Owner

Looks good to me

@nielstron nielstron merged commit 59868a1 into main Mar 23, 2026
28 checks passed
@nielstron nielstron deleted the copilot/drop-aiounittest-test-dependency branch March 23, 2026 16:54
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)

2 participants