Generating data shapes with Hypothesis

247 · Ned Batchelder · Dec. 21, 2025, 5:03 p.m.
Summary
This blog post discusses using Hypothesis, a property-based testing library, to generate test schemas for a Hasher class that deals with hashing nested data. The author shares personal experiences and challenges faced while trying to ensure that hash comparisons work correctly for data structures with the same shape but different types. It also explores how to create complex data generation strategies with Hypothesis, emphasizing its powerful capabilities for generating various forms of data for testing purposes. The post concludes on an optimistic note about learning and experimenting with Hypothesis.