{"categories":[{"label":"Testing","url":"https://skillfed.io/packages/category/software-development-testing/2"}],"enrichment":{"capability":"Mockito is a spying and stubbing framework for Python that lets you mock out dependencies, verify interactions, and stub side effects in unit tests.","skillfed_tags":["testing","mocking","unit-tests"],"use_cases":["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"],"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.\n\nVersion 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.","worth_installing":"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\u2014mocking and verification\u2014with a clean API. No known vulnerabilities and low install friction make it a straightforward addition to any test suite."},"id":"mockito","links":{"html":"https://skillfed.io/packages/mockito","md":"https://skillfed.io/packages/mockito.md","pypi":"https://pypi.org/project/mockito/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2026-04-15","license_spdx":null,"license_treatment":"permissive","name":"mockito","python_support":"supports_current","summary":"Spying framework"},"popularity":{"monthly_downloads":1570213,"position":3750,"tier":"top_5000"},"security":{"n_vulnerabilities":0},"version":"2.0.4"}
