{"categories":[{"label":"Testing","url":"https://skillfed.io/packages/category/software-development-testing/5"},{"label":"Unit","url":"https://skillfed.io/packages/category/software-development-testing-unit"},{"label":"Mocking","url":"https://skillfed.io/packages/category/software-development-testing-mocking"}],"enrichment":{"capability":"flexmock creates mock, stub, spy, and fake objects for testing Python code, with zero external dependencies and full type annotations.","skillfed_tags":["testing","mocking","type-annotated"],"use_cases":["Verify that a method was called with specific arguments and return value in a unit test.","Spy on real method calls to count invocations or check they never happen with certain inputs.","Replace a database or API client with a stub to test business logic in isolation.","Generate fake objects to populate test fixtures without writing boilerplate classes.","Assert that exception-raising methods are called the correct number of times.","Test code that depends on external services by mocking their interfaces."],"what_it_does":"flexmock is a testing library that lets you create mock, stub, spy, and fake objects for unit testing without pulling in external dependencies. It reads like English sentences rather than API calls\u2014for example, you can write `flexmock(Train).should_receive(\"get_destination\").and_return(\"Paris\").once()` to assert that a method is called exactly once with a specific return value. The library works with unittest, pytest, and doctest out of the box, and its entire public API is type-annotated for editor support and static analysis.\n\nYou use flexmock when you need to isolate code under test by replacing real objects with controlled doubles. Mocks let you verify that methods were called with expected arguments; spies let you wrap the real method and check how many times it ran; stubs replace parts of objects or classes; and fakes generate placeholder objects. Since it has no external dependencies and only uses the Python standard library, it's lightweight and straightforward to add to any test suite.","worth_installing":"Yes. flexmock is actively maintained, has no external dependencies, supports current Python versions (3.10+), carries a permissive license, and integrates seamlessly with all major test runners. It's a solid choice if you prefer readable, English-like mock declarations over the standard library's unittest.mock API."},"id":"flexmock","links":{"html":"https://skillfed.io/packages/flexmock","md":"https://skillfed.io/packages/flexmock.md","pypi":"https://pypi.org/project/flexmock/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2026-01-10","license_spdx":null,"license_treatment":"permissive","name":"flexmock","python_support":"supports_current","summary":"flexmock is a testing library for Python that makes it easy to create mocks, stubs and fakes."},"popularity":{"monthly_downloads":149003,"position":11007,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"0.13.0"}
