Generating data shapes with Hypothesis

· 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.
AUTHOR
Sponsored
Zulip logo Zulip
Organized team chat for people who take work seriously. Topic-based threading keeps conversations focused.
Try Zulip
Become a sponsor →
BLOG POST FEATURED ON

Add this plugin to your blog