$npx skillfedfor your agent

mongomock-motor

Library for mocking AsyncIOMotorClient built on top of mongomock.

With conditionsPyPI TestingReleased May 20251.5M downloads / moMITPure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — mongomock_motor-0.0.36-py3-none-any.whl
v0.0.36 · released 2025-05-16 · Python <4.0,>=3.8 · 2 runtime deps: mongomock, motor

Yes, if you write async MongoDB code with motor and want to test without a real database. The low install friction, permissive license, and current Python version support make it a straightforward addition to a test suite. The aging maintenance status (455 days since last release) is a minor concern for a stable mock library, but the lack of security vulnerabilities and active repository suggest it remains usable. Verify that the mock covers the specific motor APIs your code relies on before committing to it.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires Python 3.8 or later; async/await syntax required in calling code.
  • Low install friction with a pure-Python wheel.
  • Maintenance status is aging—last release was 455 days ago—but the repository is not archived and the package supports current Python versions through 3.13.

License · maintenance · safety

MIT (permissive) — MIT license is permissive; you can use this package freely in commercial and open-source projects with minimal restrictions.

last release 2025-05-16 (455 days) · last repo commit 2025-05-16 · 123 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 1,467,915 downloads/mo, #3,873 on PyPI

Verify before relying

pip install mongomock-motor

from mongomock_motor import AsyncMongoMockClient

async def test():
    collection = AsyncMongoMockClient()['db']['collection']
    await collection.insert_one({'a': 1})
    docs = await collection.find({}).to_list(None)
    return docs
  • Completeness of AsyncIOMotorClient API coverage—which methods and features are fully mocked vs. stubbed or missing.
  • Performance characteristics and suitability for large test datasets or high-volume mock operations.
  • Known limitations or edge cases where mock behavior diverges from actual Motor/MongoDB behavior.
Same gist for agents: .md · .json

What it is and what it does

mongomock-motor wraps the mongomock library to provide an async-compatible mock of MongoDB's AsyncIOMotorClient. It lets you write and test async MongoDB code without spinning up a real database server, using the same async/await patterns you'd use with the actual motor library. The mock implements the core AsyncIOMotorClient, Database, and Collection interfaces, returning coroutines that can be awaited in your test code.

The package is built on top of mongomock, which handles the in-memory database simulation, and motor, which defines the async API contract. It's intended for unit and integration testing of applications that use motor for async MongoDB access. Since it's a pure-Python implementation with no external database dependency, it's fast and lightweight for test environments.

Use it for

  • Unit test async MongoDB code without requiring a test MongoDB instance or Docker container.
  • Mock motor client in CI/CD pipelines where spinning up a database would slow down test runs.
  • Develop and test async MongoDB queries locally without database setup overhead.
  • Verify async query logic and collection operations in isolation before integration testing.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

With conditions

Yes, if you write async MongoDB code with motor and want to test without a real database.

The low install friction, permissive license, and current Python version support make it a straightforward addition to a test suite. The aging maintenance status (455 days since last release) is a minor concern for a stable mock library, but the lack of security vulnerabilities and active repository suggest it remains usable. Verify that the mock covers the specific motor APIs your code relies on before committing to it.

Install

mongomock-motor on PyPI

Before you install

Low install friction with a pure-Python wheel. Maintenance status is aging—last release was 455 days ago—but the repository is not archived and the package supports current Python versions through 3.13.

Requires Python 3.8 or later; async/await syntax required in calling code.

License in practice

MIT license is permissive; you can use this package freely in commercial and open-source projects with minimal restrictions.

Quickstart

pip install mongomock-motor

from mongomock_motor import AsyncMongoMockClient

async def test():
    collection = AsyncMongoMockClient()['db']['collection']
    await collection.insert_one({'a': 1})
    docs = await collection.find({}).to_list(None)
    return docs

Verify before relying

  • Completeness of AsyncIOMotorClient API coverage—which methods and features are fully mocked vs. stubbed or missing.
  • Performance characteristics and suitability for large test datasets or high-volume mock operations.
  • Known limitations or edge cases where mock behavior diverges from actual Motor/MongoDB behavior.

Package facts

LicenseMIT permissive
Python supportSupports the current Python release <4.0,>=3.8
Install frictionLow. Pure-Python wheel
Runtime dependencies
2 packages
mongomockmotor
MaintenanceAging 455 days since the last release
Last repo commit
First released
Downloads1,467,915 / month, #3,873 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
License :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Evidence: mongomock_motor-0.0.36-py3-none-any.whl

Tags

Capabilities
async mongodb mockmotor client testingmongodb async mockasyncio motor mockmongodb test doublemock asyncio motor clientmongodb unit testing
Topics
testingmongodbasync-mock
PyPI keywords
librarymongodb

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 mongodb mock”

  • mongomock-motorProvides an async mock client for MongoDB that mimics the…
  • mongomockMongomock provides an in-memory mock of MongoDB collections for…
  • pydantic-mongoProvides a Repository pattern for MongoDB with Pydantic model…

Give your agent the search over MCP, or paste the wish link into any chat.

More Testing packages

pluggy Worth it
PyPI · Libraries · released May 2025

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.

MITpure Python · 3.9+aging
1.3Bdownloads / mo
pytest Worth it
PyPI · Libraries · released Jun 2026

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.

MITpure Python · 3.10+
1.1Bdownloads / mo
virtualenv Worth it
PyPI · Libraries · released Aug 2026

virtualenv creates isolated Python environments where packages can be installed independently without affecting the system Python or other projects.

MITpure Python · 3.9+
532.9Mdownloads / mo
coverage Worth it
PyPI · Testing · released Aug 2026

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.

permissive licensepure Python · 3.10+
335.8Mdownloads / mo
pytest-asyncio Worth it
PyPI · Testing · released May 2026

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.

Apache-2.0pure Python · 3.10+
275.9Mdownloads / mo
pytest-json-ctrf Worth it
PyPI · Testing · released Jul 2026

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.

MITpure Python · 3.8+
273.0Mdownloads / mo

See also mongomock · motor · motor-types · django-mock-queries · asyncmock · odmantic · pymongo_inmemory · Flask-PyMongo · moto-ext · aioresponses