Hypothesis Python testing library
Hacker ApprovedThe most recommended of 3 property-based testing libraries
Python library that generates varied inputs to find edge-case bugs and shrinks failures to minimal examples. Common caveat: it can noticeably slow unit tests.
Python library that generates varied inputs to find edge-case bugs and shrinks failures to minimal examples. Common caveat: it can noticeably slow unit tests.
46 people gave an opinion
- recommend it
- 43
- criticize it
- 3
- approval share
- 93%
Recommended in 8 of 13 months
- November 2025: recommended
- December 2025: recommended
- January 2026: recommended
- February 2026: not recommended
- March 2026: recommended
- April 2026: recommended
- May 2026: not recommended
- June 2026: recommended
- July 2026: not recommended
- August 2026: not recommended
- September 2026: recommended
- October 2026: recommended
- November 2026: not recommended (month in progress)
Why it carries the badge
- 43 people recommend itNeeds 10 or more, met.
- 14 recommenders for every criticNeeds 2 to 1 or better, met.
- Recommended in 8 of 13 monthsNeeds 4 or more, met.
The same three rules apply to every product, and the badge can’t be bought. How the badge works
What people say about it
The reasons people give, with the number of comments that give each one. Open a reason to read what they said.
Why people recommend it
Each mark is one comment
Shrinks failures to minimal counterexamples
“Hypothesis even includes 'shrinking' to helpfully provide you with a minimal counterexample that shows the divergence.”
Comment from 6 Nov 2025 in “Hypothesis: Property-Based Testing for Python” “Python's Hypothesis has some very clever features to deal with shrinking past a monadic bind.”
Comment from 5 Nov 2025 in “Hypothesis: Property-Based Testing for Python” “Hypothesis iterates on test failures to isolate the simplest input that triggers it”
Comment from 5 Nov 2025 in “Hypothesis: Property-Based Testing for Python” - Comment from 5 Nov 2025 in “Hypothesis: Property-Based Testing for Python”
- Comment from 5 Nov 2025 in “Hypothesis: Property-Based Testing for Python”
- Comment from 5 Nov 2025 in “Hypothesis: Property-Based Testing for Python”
- Comment from 11 Jun 2026 in “Test-case reducers are underappreciated debugging tools”
Finds subtle edge-case and boundary bugs
“found hypothesis to be a big force multiplier and it uncovered many subtle/embarrassing bugs for me”
Comment from 5 Nov 2025 in “Hypothesis: Property-Based Testing for Python” “Hypothesis saved me many times. It also helped me prove the existence of bugs in third party code”
Comment from 5 Nov 2025 in “Hypothesis: Property-Based Testing for Python” “Doing this found me so many odd little edge cases around length truncation and idna encoding.”
Comment from 6 Nov 2025 in “Hypothesis: Property-Based Testing for Python” - Comment from 17 Mar 2026 in “I formally verified AI-generated code. All 4 bugs were in the integration layer”
- Comment from 5 Nov 2025 in “Hypothesis: Property-Based Testing for Python”
- Comment from 5 Nov 2025 in “Hypothesis: Property-Based Testing for Python”
- Comment from 17 Mar 2026 on Hacker News
Generates inputs that reach new paths
“Hypothesis in particular does something neat where it tries to generate random inputs that are more likely to execute novel paths within the code under test.”
Comment from 5 Nov 2025 in “Hypothesis: Property-Based Testing for Python” “it's pretty good at mutating input to cover a large amount of surface area with as few as possible examples”
Comment from 5 Nov 2025 in “Hypothesis: Property-Based Testing for Python” “Property-based testing tools like Hypothesis can generate thousands of edge cases automatically.”
Comment from 17 Dec 2025 in “I ported JustHTML from Python to JavaScript with Codex CLI and GPT-5.2 in hours” - Comment from 9 Dec 2025 in “Why frozen test fixtures are a problem on large projects and how to avoid them”
Strong built-in generators and easy adoption
“With a library like Hypothesis which both has good generators for basic types and good abstractions for combining and adapting generators, the latter seems to be less complex overall”
Comment from 5 Nov 2025 in “Hypothesis: Property-Based Testing for Python” “The simplest ones to get started with are "strings", IMO, and also gives you lots of mileage”
Comment from 5 Nov 2025 in “Hypothesis: Property-Based Testing for Python” “I think `from_type` is one of Hypothesis's most powerful and ergonomic strategies”
Comment from 24 Mar 2026 in “Hypothesis, Antithesis, Synthesis” - Comment from 6 Nov 2025 in “Hypothesis: Property-Based Testing for Python”
- Comment from 30 Dec 2025 in “AI Is Forcing Us to Write Good Code”
Other property-based testing libraries people recommend
The two most recommended other property-based testing libraries, with the same counts for each, so you can compare like for like. The tick on each bar marks the 2 to 1 line the badge needs.
| Product | Recommend | Criticize | Approval | Months | Owned | Badge |
|---|---|---|---|---|---|---|
| Hypothesis Python testing libraryThis page | 43 | 3 | 93% | 8 | — | Approved |
| Bombadil by Antithesis | 14 | 3 | 82% | 2 | — | — |
| Hegel property-based testing | 8 | 3 | 73% | 3 | — | — |
What people said
40 of the 69 comments that mention it, newest first. Each links to the original comment.
“I strongly prefer them over standard-issue unit testing for verifying algorithm implementations.”
“Reduced test cases make it way easier to figure out what the actual bug is.”
“I think `from_type` is one of Hypothesis's most powerful and ergonomic strategies”
“I'm excited to play around with Hypothesis's bitstream-based shrinking”
“The validity thing in particular is a huge pain point for a lot of users of PBT”
“It's remarkably good at finding the kind of boundary bugs AI tends to produce.”
“A Hypothesis test from period1 + period2 == total catches the silent skip immediately”
“one of the best property based testing libraries available in any language”
“I think property based testing such as with hypothesis[1] would make sense.”
“Property-based testing tools like Hypothesis can generate thousands of edge cases automatically.”
“it's like fuzz testing with some smarts and it is lovely where it fits”
“Doing this found me so many odd little edge cases around length truncation and idna encoding.”
“it's a really good start and the easiest way to bring it into an existing project”
“in Hypothesis, Hedgehog, falsify, etc. a "generator" is just a parser from numbers to values”
“Hypothesis even includes 'shrinking' to helpfully provide you with a minimal counterexample that shows the divergence.”
“introducing Hypothesis and ScalaCheck into codebases and quickly causing noticeable increases in unit test times”
“Hypothesis is a search algorithm for finding ways that we have misunderstood our code”
“Describing the "why" and design tradeoffs helps me grok a system far better”
“it just generated sequences of interactions for me and found errors in the system”
“With a library like Hypothesis which both has good generators for basic types and good abstractions for combining and adapting generators, the latter seems to be less complex overall”
“we have used hypothesis to test data validation and normalizing code to decent success”
“Hypothesis combinators quickly become unmaintainable mess for non-trivial objects”
“Often the result of running hypothesis is not a code change but a more precise description of what inputs are valid.”
“Hypothesis found this and was able to give me a test like "find x in 'İx' -> fail".”
“I've found hypothesis to be super helpful for tightening up my parser.”
“I love the idea of hypothesis! Haven't found a lot of use cases for it yet”
“Hypothesis iterates on test failures to isolate the simplest input that triggers it”
“The randomness can bite a little if that test failure happens on an unrelated branch”
“it's pretty good at mutating input to cover a large amount of surface area with as few as possible examples”
“hypothesis and other similar frameworks are deterministic and will replay the failing test on request”
“Python's Hypothesis has some very clever features to deal with shrinking past a monadic bind.”
“Hypothesis saved me many times. It also helped me prove the existence of bugs in third party code”
“Python's Hypothesis is a lot better at its heuristics for these edge cases”
“Hypothesis in particular does something neat where it tries to generate random inputs that are more likely to execute novel paths within the code under test.”
“it has no problem preserving invariants from generation in your shrinking”
“Shrinking is by far the most important and impressive part of Hypothesis.”
“The way it does counterexample shrinking is the most clever part of Hypothesis.”
“It seems to only implement a half of QuickCheck idea, because there is no counterexample shrinking. Good effort though!”
“The simplest ones to get started with are "strings", IMO, and also gives you lots of mileage”
“found hypothesis to be a big force multiplier and it uncovered many subtle/embarrassing bugs for me”
Counts come from 1,795,640 Hacker News comments, November 2025 to November 2026. How we count. Report a mistake.