asyncmock
Extension to the standard mock framework to support support async
Decision gist · record as of 2026-08-14
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.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.6 or later; requires an async runtime context to execute the await statement.
- 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 · maintenance · safety
BSD-3-Clause (permissive) — BSD-3-Clause is permissive and imposes minimal restrictions on use or redistribution in your own projects.
last release 2020-03-15 (2343 days) · last repo commit 2022-08-22 · 8 stars · archived
0 known vulnerabilities (OSV.dev, 2026-08-14) · 284,212 downloads/mo, #8,065 on PyPI
Alternatives
Verify before relying
pip install asyncmock
from asyncmock import AsyncMock
my_mock = AsyncMock()
await my_mock("foo", bar=123)
my_mock.assert_called_with("foo", bar=123)- 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+
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 on this page. Verify before relying on it.
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
asyncmock on PyPI
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.
Requires Python 3.6 or later; requires an async runtime context to execute the await statement.
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)
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 the current Python release >=3.6 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagemock |
| Maintenance | Abandoned 2,343 days since the last release |
| Last repo commit | repository archived |
| First released | |
| Downloads | 284,212 / month, #8,065 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPy |
Evidence: asyncmock-0.4.2-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “async mock testing”
- asyncmockProvides awaitable mock objects for testing async code, extending the…
- mongomock-motorProvides an async mock client for MongoDB that mimics the…
- asynctestExtends Python's unittest module with test utilities and mocks…
Give your agent the search over MCP, or paste the wish link into any chat.
More Testing packages
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.
virtualenv creates isolated Python environments where packages can be installed independently without affecting the system Python or other projects.
Coverage.py measures which lines of Python code are executed during test runs, reporting coverage percentages and identifying untested code paths.
Install it if you want to measure test completeness or enforce coverage thresholds in your project.
pytest-asyncio is a pytest plugin that enables writing and running async test functions using the asyncio library, allowing developers to await code directly within test cases.
Install it if you write tests for any asyncio-based code.
A pytest plugin that generates test reports in Common Test Report Format (CTRF) as JSON, compatible with pytest-xdist and pytest-playwright for distributed and browser-based testing.
Install it if you need CTRF-formatted test output for CI/CD integration or cross-tool reporting.
See also mock-open · flexmock · callee · looptime · time-machine · aresponses · asynctest · mongomock-motor · pytest-mock