Comparison
flexmock vs mock vs pretend
Maintenance, adoption and momentum side by side, from PyPI, GitHub and deps.dev data refreshed every day.
flexmock is a testing library for Python that makes it easy to create mocks, stubs and fakes.
Maintained. Last release 3 weeks ago, commits in 4 of the last 26 weeks. Weaker on commit activity and release cadence.
pip install flexmockRolling 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.
- flexmock is better maintained: Pythie’s Index 58 against 29.
- flexmock is growing fastest: downloads +32% over the last month.
Side by side
| Metric | flexmock | mock | pretend |
|---|---|---|---|
| Pythie’s Index | Pythie’s Index: 58 | Pythie’s Index: 29 | Pythie’s Index: 20 |
| Verdict | Maintained | Low maintenance activity | Likely abandoned |
| Downloads / month | 129.8K | 21M | 193.8K |
| Downloads, month over month | +32% | +1% | +6% |
| GitHub stars | 65 | 537 | 318 |
| Stars, last 7 days | – | – | – |
| Direct dependents | 8 | 708 | 2 |
| Last release | Nov 11, 2026 | Mar 3, 2025 | Apr 14, 2018 |
| Releases, 12 months | 2 | 0 | 0 |
| Weeks with commits | 4 / 26 | 0 / 26 | 0 / 26 |
| Recent contributors | 8 | 31 | 11 |
| First release | Nov 2010 | Oct 2008 | Nov 2012 |
| Python versions | 3.11 – 3.15 | 3.6 – 3.13 | 3.2 – 3.6 |
| License | BSD-2-Clause | BSD-2-Clause | non-standard |
| Known vulnerabilities | None | None | None |
Bold marks the best value in each row. Pythie’s Index rates maintenance out of 100: how it works.