$npx skillfedfor your agent

mockito

Spying framework

Worth itPyPI TestingReleased Apr 20261.6M downloads / moMITPure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — mockito-2.0.4-py3-none-any.whl
v2.0.4 · released 2026-04-15 · Python >=3.8

Yes. Mockito is a mature, actively maintained testing framework with zero dependencies, permissive licensing, and broad Python version support. It solves a core testing need—mocking and verification—with a clean API. No known vulnerabilities and low install friction make it a straightforward addition to any test suite.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires Python >=3.8
  • Low friction: pure Python wheel with no runtime dependencies.
  • Actively maintained with recent release (121 days ago).

License · maintenance · safety

MIT (permissive) — MIT license is permissive; you can use this freely in commercial and open-source projects with minimal restrictions.

last release 2026-04-15 (121 days)

0 known vulnerabilities (OSV.dev, 2026-08-14) · 1,570,213 downloads/mo, #3,750 on PyPI

Verify before relying

pip install mockito

from mockito import when, mock, unstub
import os

when(os.path).exists('/foo').thenReturn(True)
result = os.path.exists('/foo')  # returns True
unstub()
  • Whether async/await support covers all common async testing patterns
  • Performance characteristics when mocking large numbers of interactions
  • Compatibility with popular test runners beyond pytest
Same gist for agents: .md · .json

What it is and what it does

Mockito is a mocking and spying framework for Python unit tests, originally inspired by the Java library of the same name. It lets you stub out method calls to return specific values, verify that functions were called with expected arguments, and replace real dependencies with controlled fakes during testing. The core workflow is straightforward: use `when()` to set up a stub that returns a value when called, use the stubbed code in your test, then call `unstub()` to clean up.

Version 2 adds first-class support for async/await, properties, descriptors, and ordered verification across multiple mocks. The framework handles context managers automatically, checking that stubs were actually used unless disabled. It has no runtime dependencies beyond Python itself, making it lightweight to add to any test suite.

Use it for

  • Stub external API calls (e.g., requests library) to return fake responses without hitting the network
  • Verify that your code calls a dependency with the correct arguments and number of times
  • Mock filesystem operations (os.path.exists, open) to test error handling without touching disk
  • Test async code by mocking async functions and verifying their call patterns
  • Replace database queries with controlled mock responses to isolate unit tests from data layer

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

Worth it

Yes.

Mockito is a mature, actively maintained testing framework with zero dependencies, permissive licensing, and broad Python version support. It solves a core testing need—mocking and verification—with a clean API. No known vulnerabilities and low install friction make it a straightforward addition to any test suite.

Install

mockito on PyPI

Before you install

Low friction: pure Python wheel with no runtime dependencies. Actively maintained with recent release (121 days ago). Supports Python >=3.8 and targets current Python versions.

Requires Python >=3.8

License in practice

MIT license is permissive; you can use this freely in commercial and open-source projects with minimal restrictions.

Quickstart

pip install mockito

from mockito import when, mock, unstub
import os

when(os.path).exists('/foo').thenReturn(True)
result = os.path.exists('/foo')  # returns True
unstub()

Verify before relying

  • Whether async/await support covers all common async testing patterns
  • Performance characteristics when mocking large numbers of interactions
  • Compatibility with popular test runners beyond pytest

Package facts

LicenseMIT permissive
Python supportSupports the current Python release >=3.8
Install frictionLow. Pure-Python wheel
Runtime dependenciesNone
MaintenanceActively maintained 121 days since the last release
First released
Downloads1,570,213 / month, #3,750 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14

Evidence: mockito-2.0.4-py3-none-any.whl

Tags

Capabilities
mock library pythonstubbing frameworkspy on function callsverify mock interactionsunit test mockingmock objects testingstub side effects
Topics
testingmockingunit-tests

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “stubbing framework”

  • mockitoMockito is a spying and stubbing framework for Python that lets you…
  • stubsProvides a context-manager syntax for temporarily replacing function…
  • pretendPretend provides a lightweight library for creating stub objects in…

Give your agent the search over MCP, or paste the wish link into any chat.

More Testing packages

pluggy Worth it
PyPI · Libraries · released May 2025

Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.

Install it if you're building an extensible application or framework.

MITpure Python · 3.9+aging
1.3Bdownloads / mo
pytest Worth it
PyPI · Libraries · released Jun 2026

pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.

MITpure Python · 3.10+
1.1Bdownloads / mo
virtualenv Worth it
PyPI · Libraries · released Aug 2026

virtualenv creates isolated Python environments where packages can be installed independently without affecting the system Python or other projects.

MITpure Python · 3.9+
532.9Mdownloads / mo
coverage Worth it
PyPI · Testing · released Aug 2026

Coverage.py measures which lines of Python code are executed during test runs, reporting coverage percentages and identifying untested code paths.

Install it if you want to measure test completeness or enforce coverage thresholds in your project.

permissive licensepure Python · 3.10+
335.8Mdownloads / mo
pytest-asyncio Worth it
PyPI · Testing · released May 2026

pytest-asyncio is a pytest plugin that enables writing and running async test functions using the asyncio library, allowing developers to await code directly within test cases.

Install it if you write tests for any asyncio-based code.

Apache-2.0pure Python · 3.10+
275.9Mdownloads / mo
pytest-json-ctrf Worth it
PyPI · Testing · released Jul 2026

A pytest plugin that generates test reports in Common Test Report Format (CTRF) as JSON, compatible with pytest-xdist and pytest-playwright for distributed and browser-based testing.

Install it if you need CTRF-formatted test output for CI/CD integration or cross-tool reporting.

MITpure Python · 3.8+
273.0Mdownloads / mo

See also flexmock · stubs · pretend · pytest-stub · pytest-mock · requests-mock · types-mock · asyncmock · pip-install-test · pact-python