Hacker ApprovedDepartments

Hypothesis Python testing library

Hacker Approved

The 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%
Each figure is one person. RecommendsCriticizes

Recommended in 8 of 13 months

  1. November 2025: recommended
  2. December 2025: recommended
  3. January 2026: recommended
  4. February 2026: not recommended
  5. March 2026: recommended
  6. April 2026: recommended
  7. May 2026: not recommended
  8. June 2026: recommended
  9. July 2026: not recommended
  10. August 2026: not recommended
  11. September 2026: recommended
  12. October 2026: recommended
  13. 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”
  • 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”
  • 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”
  • 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”

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.

Hypothesis Python testing library compared with 2 alternatives
ProductRecommendCriticizeApprovalMonthsOwnedBadge
Hypothesis Python testing libraryThis page43393%8—Approved
Bombadil by Antithesis14382%2——
Hegel property-based testing8373%3——
See all 3 property-based testing libraries, ranked

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.”

RecommendsComment from 16 Sep 2026 in “This Code Is CRAP (2011)”

“Reduced test cases make it way easier to figure out what the actual bug is.”

RecommendsComment from 11 Jun 2026 in “Test-case reducers are underappreciated debugging tools”

“I think `from_type` is one of Hypothesis's most powerful and ergonomic strategies”

RecommendsComment from 24 Mar 2026 in “Hypothesis, Antithesis, Synthesis”

“I'm excited to play around with Hypothesis's bitstream-based shrinking”

RecommendsComment from 24 Mar 2026 in “Hypothesis, Antithesis, Synthesis”

“The validity thing in particular is a huge pain point for a lot of users of PBT”

RecommendsComment from 24 Mar 2026 in “Hypothesis, Antithesis, Synthesis”

“It's remarkably good at finding the kind of boundary bugs AI tends to produce.”

RecommendsComment from 17 Mar 2026 on Hacker News

“A Hypothesis test from period1 + period2 == total catches the silent skip immediately”

RecommendsComment from 17 Mar 2026 in “I formally verified AI-generated code. All 4 bugs were in the integration layer”

“one of the best property based testing libraries available in any language”

RecommendsComment from 30 Dec 2025 in “AI Is Forcing Us to Write Good Code”

“I think property based testing such as with hypothesis[1] would make sense.”

RecommendsComment from 18 Dec 2025 in “Your job is to deliver code you have proven to work”

“Property-based testing tools like Hypothesis can generate thousands of edge cases automatically.”

RecommendsComment from 17 Dec 2025 in “I ported JustHTML from Python to JavaScript with Codex CLI and GPT-5.2 in hours”

“it's like fuzz testing with some smarts and it is lovely where it fits”

RecommendsComment from 9 Dec 2025 in “Why frozen test fixtures are a problem on large projects and how to avoid them”

“Doing this found me so many odd little edge cases around length truncation and idna encoding.”

RecommendsComment from 6 Nov 2025 in “Hypothesis: Property-Based Testing for Python”

“it's a really good start and the easiest way to bring it into an existing project”

RecommendsComment from 6 Nov 2025 in “Hypothesis: Property-Based Testing for Python”

“in Hypothesis, Hedgehog, falsify, etc. a "generator" is just a parser from numbers to values”

RecommendsComment from 6 Nov 2025 in “Hypothesis: Property-Based Testing for Python”

“Hypothesis even includes 'shrinking' to helpfully provide you with a minimal counterexample that shows the divergence.”

RecommendsComment from 6 Nov 2025 in “Hypothesis: Property-Based Testing for Python”

“introducing Hypothesis and ScalaCheck into codebases and quickly causing noticeable increases in unit test times”

MixedComment from 6 Nov 2025 in “Hypothesis: Property-Based Testing for Python”

“Hypothesis is a search algorithm for finding ways that we have misunderstood our code”

RecommendsComment from 6 Nov 2025 in “Hypothesis: Property-Based Testing for Python”

“Describing the "why" and design tradeoffs helps me grok a system far better”

RecommendsComment from 5 Nov 2025 in “Hypothesis: Property-Based Testing for Python”

“it just generated sequences of interactions for me and found errors in the system”

RecommendsComment from 5 Nov 2025 in “Hypothesis: Property-Based Testing for Python”

“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”

RecommendsComment from 5 Nov 2025 in “Hypothesis: Property-Based Testing for Python”

“we have used hypothesis to test data validation and normalizing code to decent success”

MixedComment from 5 Nov 2025 in “Hypothesis: Property-Based Testing for Python”

“Hypothesis combinators quickly become unmaintainable mess for non-trivial objects”

MixedComment from 5 Nov 2025 in “Hypothesis: Property-Based Testing for Python”

“Often the result of running hypothesis is not a code change but a more precise description of what inputs are valid.”

RecommendsComment from 5 Nov 2025 in “Hypothesis: Property-Based Testing for Python”

“Hypothesis found this and was able to give me a test like "find x in 'İx' -> fail".”

RecommendsComment from 5 Nov 2025 in “Hypothesis: Property-Based Testing for Python”

“I've found hypothesis to be super helpful for tightening up my parser.”

RecommendsComment from 5 Nov 2025 in “Hypothesis: Property-Based Testing for Python”

“I love the idea of hypothesis! Haven't found a lot of use cases for it yet”

MixedComment from 5 Nov 2025 in “Hypothesis: Property-Based Testing for Python”

“Hypothesis iterates on test failures to isolate the simplest input that triggers it”

RecommendsComment from 5 Nov 2025 in “Hypothesis: Property-Based Testing for Python”

“The randomness can bite a little if that test failure happens on an unrelated branch”

MixedComment 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”

RecommendsComment from 5 Nov 2025 in “Hypothesis: Property-Based Testing for Python”

“hypothesis and other similar frameworks are deterministic and will replay the failing test on request”

RecommendsComment from 5 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.”

RecommendsComment 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”

RecommendsComment from 5 Nov 2025 in “Hypothesis: Property-Based Testing for Python”

“Python's Hypothesis is a lot better at its heuristics for these edge cases”

RecommendsComment from 5 Nov 2025 in “Hypothesis: Property-Based Testing for Python”

“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.”

RecommendsComment from 5 Nov 2025 in “Hypothesis: Property-Based Testing for Python”

“it has no problem preserving invariants from generation in your shrinking”

RecommendsComment from 5 Nov 2025 in “Hypothesis: Property-Based Testing for Python”

“Shrinking is by far the most important and impressive part of Hypothesis.”

RecommendsComment from 5 Nov 2025 in “Hypothesis: Property-Based Testing for Python”

“The way it does counterexample shrinking is the most clever part of Hypothesis.”

RecommendsComment from 5 Nov 2025 in “Hypothesis: Property-Based Testing for Python”

“It seems to only implement a half of QuickCheck idea, because there is no counterexample shrinking. Good effort though!”

MixedComment 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”

RecommendsComment from 5 Nov 2025 in “Hypothesis: Property-Based Testing for Python”

“found hypothesis to be a big force multiplier and it uncovered many subtle/embarrassing bugs for me”

RecommendsComment from 5 Nov 2025 in “Hypothesis: Property-Based Testing for Python”

Counts come from 1,795,640 Hacker News comments, November 2025 to November 2026. How we count. Report a mistake.