--- id: asyncmock version: "0.4.2" license: BSD-3-Clause license_treatment: permissive maintenance: abandoned --- # asyncmock — Extension to the standard mock framework to support support async License: permissive · Maintenance: abandoned · Downloads: 284.2K/mo ## What it is and what it does Asyncmock extends the standard mock library to support testing async code by providing an AsyncMock class that behaves like a regular Mock but can be awaited. It handles async method calls, side effects, and return values, allowing developers to mock coroutines and async functions in unit tests. The package was designed as a backport for Python versions before 3.8, when awaitable mocks were not yet part of the standard library. It is now superseded by built-in functionality—the description notes that Mock 4.0+ (included within Python 3.8+) now includes an awaitable mock mock.AsyncMock, which is recommended for new projects. The package is no longer maintained—its repository is archived and the last release was in 2020-03-15. Use it for: - Mock async functions in unit tests for Python 3.6–3.7 projects that predate built-in AsyncMock - Test async methods with call assertions and side effects in older codebases - Verify that async code correctly awaits mocked coroutines during development ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides awaitable mock objects for testing async code, extending the standard mock framework with AsyncMock that can be awaited like coroutines. No, not for new projects. The description explicitly notes that Mock 4.0+ (included within Python 3.8+) now includes mock.AsyncMock and recommends it for new projects. For legacy Python 3.6–3.7 codebases, this package is an option, but its abandonment means no maintenance or compatibility updates. ## Install pip install asyncmock uv add asyncmock poetry add asyncmock ## Installing asyncmock Before you install: Low friction installation with a single runtime dependency (mock). However, the package is archived and abandoned since 2022-08-22, with no releases after 2020-03-15. License in practice: BSD-3-Clause is permissive and imposes minimal restrictions on use or redistribution in your own projects. Quickstart: pip install asyncmock from asyncmock import AsyncMock my_mock = AsyncMock() await my_mock("foo", bar=123) my_mock.assert_called_with("foo", bar=123) Requires Python 3.6 or later; requires an async runtime context to execute the await statement. Verify before relying: - Whether the package remains compatible with current Python versions despite abandonment since 2022 - How much of asyncmock's functionality overlaps with mock.AsyncMock available in Python 3.8+ ## Package facts - License: BSD-3-Clause (permissive) - Python support: supports_current - Install friction: low - Maintenance: abandoned - Downloads: 284.2K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags async mock testing, mock async functions, asyncio test mocking, awaitable mock objects, async unit testing, coroutine mocking, async pytest mocking, testing, legacy, abandoned [View on SkillFed](https://skillfed.io/packages/asyncmock) · [View on PyPI](https://pypi.org/project/asyncmock/)