kgb
JSON →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.
Traffic · last 30 days ↑150% vs prev 7d
total hits 13
actors 5 distinct systems
last hit 4d ago ByteDance
top countries 🇺🇸 United States · 🇬🇧 United Kingdom · BD · 🇩🇪 Germany · OM
Resources
packagepypi.org/project/kgb/ ↗
API endpoints
full doc /v1/registry/kgb
install /v1/registry/kgb/install
compatibility /v1/registry/kgb/compatibility