--- id: aiounittest version: "1.5.0" license: MIT license_treatment: permissive maintenance: aging --- # aiounittest — Test asyncio code more easily. License: permissive · Maintenance: aging · Downloads: 300.5K/mo ## What it is and what it does aiounittest is a test helper library that extends unittest.TestCase to support testing asyncio code using async/await syntax. It lets you write test methods as async functions and run them within an event loop, while still supporting synchronous tests in the same class. The library also provides utilities like AsyncMockIterator for mocking async iterators and futurized mocks for coroutines. The package is designed to bridge the gap between unittest and asyncio, making it easier to test asynchronous code without boilerplate. However, for Python 3.8 and newer, the standard library now includes unittest.IsolatedAsyncioTestCase, which provides built-in asyncio support and may be preferable for new projects targeting recent Python versions. Use it for: - Testing async functions and coroutines in projects targeting Python 3.4–3.7 before IsolatedAsyncioTestCase was available - Writing mixed test suites with both synchronous and asynchronous test methods in a single class - Mocking async iterators and coroutines using the library's AsyncMockIterator and futurized utilities - Migrating legacy asyncio test code that predates Python 3.8's built-in async test support ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides a test case class for writing unit tests of asyncio code using async/await syntax, alongside support for synchronous tests in the same suite. Yes, but with conditions. Install if you are maintaining code on Python 3.4–3.7 or need to test asyncio code in an existing unittest suite. For new projects targeting Python 3.8+, prefer the standard library's unittest.IsolatedAsyncioTestCase instead. The package is stable and permissively licensed, but aging maintenance means it may not receive updates for new Python features. ## Install pip install aiounittest uv add aiounittest poetry add aiounittest ## Installing aiounittest Before you install: Low install friction with a single runtime dependency (wrapt). Maintenance status is aging—last release was 525 days ago, though the repository remains active with a recent commit on 2026-01-19. For Python 3.8+, the standard library's unittest.IsolatedAsyncioTestCase is now the recommended alternative. License in practice: MIT license is permissive, allowing use in commercial and private projects with minimal restrictions beyond attribution. Quickstart: pip install aiounittest import asyncio import aiounittest class MyTest(aiounittest.AsyncTestCase): async def test_async_add(self): result = await asyncio.sleep(0.1) self.assertEqual(result, None) Verify before relying: - Whether wrapt dependency is required at runtime or only for specific features - Current test coverage and whether the package is actively maintained despite aging status - Performance characteristics compared to unittest.IsolatedAsyncioTestCase in Python 3.8+ ## Package facts - License: MIT (permissive) - Python support: unspecified - Install friction: low - Maintenance: aging - Downloads: 300.5K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags asyncio unit testing, async test framework, test async code, asyncio test case, coroutine testing, async await testing, unittest asyncio, asyncio, testing, legacy-support [View on SkillFed](https://skillfed.io/packages/aiounittest) · [View on PyPI](https://pypi.org/project/aiounittest/)