Introducing wrapture
Blog · Watch/Read · (gathered 2026-09-03)
wraptureis a new Python library by Graham Dumpleton that extendswrapt’s monkeypatching ideas to provide a unified solution for both testing (as an alternative tounittest.mock) and observability/tracing, allowing easy wrapping of functions/methods to trace access or override return values.- It includes OpenTelemetry support and a configuration-based mechanism for adding tracing to existing projects, alongside advanced testing patterns like stubbing return values (
on_call.returns) and transforming results (transforms_result). - Notably,
wrapturewas entirely written by an AI assistant under Graham Dumpleton’s “agent-driven” direction, emphasizing that human design and expertise guided the AI’s implementation, distinguishing it from “vibe coding.”