Comparison
mongomock vs mongorun vs pymongo_inmemory vs pytest-mongo
Maintenance, adoption and momentum side by side, from PyPI, GitHub and deps.dev data refreshed every day.
Fake pymongo stub for testing simple MongoDB-dependent code
Low maintenance activity. Last release over 2 years ago, commits in 0 of the last 26 weeks. Weaker on commit activity and recent releases.
pip install mongomockA utility to quickly set up complex MongoDB test environments on a local machine
Actively maintained. Last release 3 weeks ago, commits in 5 of the last 26 weeks. A safe choice.
pip install mongorunA mongo mocking library with an ephemeral MongoDB running in memory.
Low maintenance activity. Last release 21 months ago, commits in 0 of the last 26 weeks. Weaker on commit activity and recent releases.
pip install pymongo-inmemoryMongoDB process and client fixtures plugin for Pytest.
Actively maintained. Last release 3 weeks ago, commits in 26 of the last 26 weeks. A safe choice.
pip install pytest-mongoIn short
- mongomock is the most used: 10M downloads a month, 74× more than pymongo_inmemory.
- pytest-mongo is better maintained: Pythie’s Index 81 against 17.
- mongorun is growing fastest: downloads +94472% over the last month.
- mongorun is the newcomer: first released Apr 2026.
Side by side
| Metric | mongomock | mongorun | pymongo_inmemory | pytest-mongo |
|---|---|---|---|---|
| Pythie’s Index | Pythie’s Index: 17 | Pythie’s Index: 71 | Pythie’s Index: 23 | Pythie’s Index: 81 |
| Verdict | Low maintenance activity | Actively maintained | Low maintenance activity | Actively maintained |
| Downloads / month | 10M | 98.4K | 135.9K | 20.2K |
| Downloads, month over month | +16% | +94472% | -26% | -75% |
| GitHub stars | 1K | 0 | 54 | 25 |
| Stars, last 7 days | – | – | – | – |
| Direct dependents | 63 | 0 | 1 | 0 |
| Last release | Nov 16, 2024 | Nov 13, 2026 | Mar 13, 2025 | Nov 9, 2026 |
| Releases, 12 months | 0 | 4 | 0 | 4 |
| Weeks with commits | 0 / 26 | 5 / 26 | 0 / 26 | 26 / 26 |
| Recent contributors | 11 | 8 | 13 | 2 |
| First release | Jun 2012 | Apr 2026 | Aug 2019 | Aug 2016 |
| Python versions | 3.8 – 3.12 | 3.10 – 3.14 | 3.7 – 3.13 | 3.11 – 3.15 |
| License | ISC | Apache-2.0 | MIT | LGPL-3.0-or-later |
| Known vulnerabilities | None | None | None | None |
Bold marks the best value in each row. Pythie’s Index rates maintenance out of 100: how it works.