{"library":"kgb","type":"library","category":null,"description":"kgb is a Python library that provides utilities for creating function spies in unit tests, offering a powerful alternative to traditional mocking. It intercepts and records calls to functions, tracking arguments and return values, and can modify function behavior at the bytecode level. Unlike some mocking frameworks, kgb can spy on top-level functions in addition to class methods. It supports popular testing frameworks like unittest, pytest, nose, and nose2, and maintains an active release cadence, with recent versions adding support for the latest Python releases.","language":"python","status":"active","version":"7.3","tags":["testing","mocking","spy","unit testing","pytest","unittest"],"last_verified":"Wed May 20","install":[{"cmd":"pip install kgb","imports":["from kgb import SpyAgency","from kgb.asserts import assert_spy_called_with"]}],"homepage":null,"github":"https://github.com/beanbaginc/kgb","docs":"https://github.com/beanbaginc/kgb","changelog":null,"pypi":"https://pypi.org/project/kgb/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"compatibility":{"summary":{"python_range":"3.10–3.9","success_rate":100,"avg_install_s":1.6,"avg_import_s":0.15,"wheel_type":"wheel"},"url":"https://checklist.day/v1/registry/kgb/compatibility"}}