Comparison
mock vs pretend
Maintenance, adoption and momentum side by side, from PyPI, GitHub and deps.dev data refreshed every day.
Rolling backport of unittest.mock for all Pythons
Low maintenance activity. Last release 21 months ago, commits in 0 of the last 26 weeks. Weaker on commit activity and recent releases. It brings a standard-library module to older Pythons: on current versions, use the built-in one.
$
pip install mockA library for stubbing in Python
Likely abandoned. No release or commit for years (last release over 8 years ago).
$
pip install pretendIn short
- pretend looks abandoned: avoid it for new projects.
- mock is the most used: 21M downloads a month, 108× more than pretend.
- mock also has the best Pythie’s Index (29).
Side by side
| Metric | mock | pretend |
|---|---|---|
| Pythie’s Index | Pythie’s Index: 29 | Pythie’s Index: 20 |
| Verdict | Low maintenance activity | Likely abandoned |
| Downloads / month | 21M | 193.8K |
| Downloads, month over month | +1% | +6% |
| GitHub stars | 537 | 318 |
| Stars, last 7 days | – | – |
| Direct dependents | 708 | 2 |
| Last release | Mar 3, 2025 | Apr 14, 2018 |
| Releases, 12 months | 0 | 0 |
| Weeks with commits | 0 / 26 | 0 / 26 |
| Recent contributors | 31 | 11 |
| First release | Oct 2008 | Nov 2012 |
| Python versions | 3.6 – 3.13 | 3.2 – 3.6 |
| License | BSD-2-Clause | non-standard |
| Known vulnerabilities | None | None |
Bold marks the best value in each row. Pythie’s Index rates maintenance out of 100: how it works.