{"categories":[{"label":"Testing","url":"https://skillfed.io/packages/category/software-development-testing/3"}],"enrichment":{"capability":"Pretend provides a lightweight library for creating stub objects in tests that return pre-canned responses without computation, plus utilities for recording calls and raising exceptions.","skillfed_tags":["test-doubles","stubbing"],"use_cases":["Create test doubles with fixed return values to isolate code under test from external dependencies","Stub methods that should raise exceptions to test error-handling paths without triggering real failures","Record function calls during tests to verify a stub was invoked with expected arguments","Replace real objects in unit tests with lightweight stubs that return pre-canned responses","Test code that depends on external APIs by providing stub objects with fixed attributes"],"what_it_does":"Pretend is a test-focused library that makes it easy to create stub objects\u2014objects that return fixed values rather than performing computation. Unlike mocking libraries, stubs are simpler and more focused: you define what attributes or methods return, and the stub returns exactly that. The library includes a stub() function to create objects with predefined attributes and methods, a raiser() helper to make stubs raise exceptions, and a call_recorder() utility to track how a stub was invoked.\n\nThe design philosophy emphasizes passing stubs as arguments to code under test rather than monkey-patching them globally. This encourages tests that verify computation results rather than implementation details. Pretend has no runtime dependencies and installs cleanly via pip, making it a minimal addition to a test suite.","worth_installing":"Yes, if you prefer lightweight stubs over full mocking frameworks and your test suite targets Python versions the package supports. The library is dormant but stable, carries no known vulnerabilities, and has zero dependencies. However, verify compatibility with your Python version\u2014classifiers only list up to 3.6, and the last release was 2018-04-14. If you need active maintenance or support for modern Python versions, consider alternatives."},"id":"pretend","links":{"html":"https://skillfed.io/packages/pretend","md":"https://skillfed.io/packages/pretend.md","pypi":"https://pypi.org/project/pretend/"},"maintenance":{"status":"dormant"},"meta":{"latest_release":"2018-04-14","license_spdx":null,"license_treatment":"permissive","name":"pretend","python_support":"unspecified","summary":"A library for stubbing in Python"},"popularity":{"monthly_downloads":419337,"position":6799,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"1.0.9"}
