HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
HypothesisWorks
hypothesis
Python2015–2025
HypothesisWorks / hypothesis

hypothesis

The property-based testing library for Python

22Distinct people
25Mentions
0Explicit recommenders
9.2KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

The property-based testing library for Python

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 3:56:07 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year25 dated mentions

Observed mentions: 2015-03-21 07:38:12 UTC to 2025-04-21 02:44:04 UTC.

0123452015-01-01 00:00:00 UTC to 2016-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments20152016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 5 mentions; 1 submissions, 4 comments2017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 3 mentions; 2 submissions, 1 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments20202021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 3 mentions; 1 submissions, 2 comments2025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments2025

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20152015-01-01 00:00:00 UTC2016-01-01 00:00:00 UTC202
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC514
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC321
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC000
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC202
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC202
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC202
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC202
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC101
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC312
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC303

What Hacker News says

25 sources
I have used Python's `hypothesis` as well, and I wish it were better. We had to rip it out at work as we were running into too many issues. I have also used Haskell's `QuickCheck` and Clojure's `spec` / `test.check` and have had a great experience with these. In my experience they "just work". Conversely, if you're trying to generate non-trivial datasets, you will likely run into situations where your specification is correct but Hypothesis' implementation fails to generate data, or takes an unreasonable amount of time to generate data. Example: Generate a 100x25 array of numeric values, where the only condition is that they must not all be zero simultaneously. [1] [1] https://github.com/HypothesisWorks/hypothesis/issues/3493
In Property-Based Testing for the People
Anecdotally, I had a fantastic experience with `clojure.spec.alpha` (with or without `test.check`), and when I went to use python's `hypothesis` it was just... abysmal. It seems like Hypothesis is unable to handle simple but "large" data sets >>by design<<, where "large" is really not so large. [0] It was such a pain that we ripped out Hypothesis (and generative testing altogether, sadly) completely from our python test suite at work. [0] https://github.com/HypothesisWorks/hypothesis/issues/3493
In The sad state of property-based testing libraries
But then add tests! Tests for LaTeX equations that had never been executable as code. There are a number of ways to generate tests for functions and methods with and without parameter and return types. Property-based testing is one way to auto-generate test cases. Property testing: https://en.wikipedia.org/wiki/Property_testing awesome-python-testing#property-based-testing: https://github.com/cleder/awesome-python-testing#property-ba... https://github.com/HypothesisWorks/hypothesis : > Hypothesis is a family of testing libraries which let you write tests parametrized by a source of examples. A Hypothesis implementation then generates simple and comprehensible examples that make your tests fail. This simplifies writing your tests and makes them more powerful at the same time, by letting software automate the boring bits and do them to a
Read the rest
higher standard than a human would, freeing you to focus on the higher level test logic. > This sort of testing is often called "property-based testing", and the most widely known implementation of the concept is the Haskell library QuickCheck, but Hypothesis differs significantly from QuickCheck and is designed to fit idiomatically and easily into existing styles of testing that you are used to, with absolutely no familiarity with Haskell or functional programming needed. Fuzzing is another way to auto-generate tests and test cases; by testing combinations of function parameters as a traversal through a combinatorial graph. Fuzzing: https://en.wikipedia.org/wiki/Fuzzing Google/atheris is based on libFuzzer: https://github.com/google/atheris Clusterfuzz supports libFuzzer and APFL: https://google.github.io/clusterfuzz/setting-up-fuzzing/libf...
In Pix2tex: Using a ViT to convert images of equations into LaTeX code
Author note: The original title is "Property based testing: tale of two shrinkers", which is retroactively a bit bad title choice on my part; the title I submitted it under sums the content up better I believe. This is a talk I gave internally at my company (I'm also planning to give an updated version at [Haskell Exchange 2022](https://events.skillsmatter.com/haskellx2022) in a month or so), about approaches to shrinking in PBT libraries and their issues, and how the [Hypothesis](https://github.com/HypothesisWorks/hypothesis) approach ("internal shrinking") solves those issues yet remains mostly unknown. There's also a bit of a call to action to PBT library maintainers to adopt this approach at the end :) I'm a co-maintainer of [elm-test](https://github.com/elm-explorations/test), the Elm PBT library, which has historically used the rose
Read the rest
tree approach (second one mentioned in the video) and recently switched to the internal shrinking approach in v2.0.0. We like it so far!
In [dead]
The article separates types from property testing, I can sympathize, it is true, it makes sense. But testing is a tool for reliability to be used in conjunction with so many other tools like, you guessed it, typing. In 2016 when this article was written, typing wasn't yet popular in Python. But now it is, and indeed more popular than property testing will ever be. But Hypothesis doesn't support typing very well, though they do attempt [0]. But just take a look at that list of caveats. It is a hack job in comparison. Even if you don't generate your Strategies from types, Hypothesis requires you to know whether the type you construct is internally a sum type or a product type. [1] The testing framework shouldn't have to know these details, this is unnecessary complexity. If you think the QuickCheck strategy of having lawless unnamed instanc
Read the rest
es is bad, there is now a Haskell library[2] where Gens are values, like they are in Hypothesis (where they are called Strategies). It probably became popular only after 2016, which could be why the article doesn't mention it. Hypothesis also supports "registering" strategies so that they are auto-discovered on-demand. It's done at runtime of course, unlike with QuickCheck, where it is type class based, as previously mentioned. I applaud the article for cementing that property checking can work without typing, but I worry that readers will conclude that Haskell does it wrong, which is a false implication. You don't have to use ad-hoc polymorphism for discovering strategies. [0]: https://hypothesis.readthedocs.io/en/latest/data.html#hypoth... [1]: https://github.com/HypothesisWorks/hypothesis/issues/2693#is... [2]: https://hackage.haskell.org/package/hedgehog#readme
In What is property-based testing? (2016)
The inputs shouldn’t be “random”, but the idea is that you should provide an input distribution that’s roughly representative of your expected distribution of real-world values (+ some perturbation to find edge cases). As for frameworks in the languages you listed... Ruby and Python: https://github.com/HypothesisWorks/hypothesis Elixir and Erlang: https://github.com/proper-testing/proper Node and JS: https://jsverify.github.io/ As for real world use-cases, imagine you’re writing a program that accepts timestamps as input and has to implement branching, requirements-defined business logic based off of them. When you’re writing your unit tests you can use the requirements to select timestamps that are “known good” and “known bad”, but it’s hard to explore this state space on your own. Same thing goes for handling unexpected inputs to certai
Read the rest
n functions. You probably don’t want to check _every_ type of input for _every_ dynamic function, but it might make sense to make sure that certain “entry points” to your program fail in the expected manner when they get poorly typed input.
In Deno will stop using TypeScript
> lack of typing information isn't "free solo" hard but it certainly makes life a lot less pleasant. One of the projects I work on has switched to full type hinting along with heavy mypy¹ usage, and it has become an absolute pleasure to work with. Along with hypothesis², I can't recommend mypy enough. It must be said that retrofitting either to an existing project is a lot of work though. 1. http://www.mypy-lang.org/ 2. https://github.com/HypothesisWorks/hypothesis
In Python is not a great programming language

Showing the 15 most recent of 25 sources. Enable JavaScript to search and browse every indexed mention.

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.