kgb

JSON →
library 7.3 ·python
verified May 20, 2026 install

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.

total hits 18
actors 5 distinct systems
last hit 1d ago Bingbot
Script
3
GPTBot
2
Search engines
1
Humans
8

top countries VN · 🇩🇪 Germany · 🇺🇸 United States · UZ · 🇮🇳 India