Comparison
mongomock 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 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: 9.8M downloads a month, 71× more than pymongo_inmemory.
- pytest-mongo is better maintained: Pythie’s Index 81 against 17.
Side by side
| Metric | mongomock | pymongo_inmemory | pytest-mongo |
|---|---|---|---|
| Pythie’s Index | Pythie’s Index: 17 | 23 |