Comparison
mock vs mockito 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 mockSpying framework
Maintained. Last release 8 months ago.
$
pip install mockitoA 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: 20.3M downloads a month, 16× more than mockito.
- mockito is better maintained: Pythie’s Index 67 against 29.