
About Hypothesis
Hypothesis is a property-based testing library for Python. You describe the range of inputs a function should handle, and it generates examples to check them.
What it does
Instead of writing one example per test, you write a property that should hold for all inputs. Hypothesis chooses inputs, including unusual edge cases you might miss. When it finds a failure, it reports the simplest example that still fails, which makes the bug easier to understand. It works with pytest, unittest and other ways of calling Python functions.
Key features
- Generates inputs from strategies you describe
- Finds edge cases you may not have thought of
- Shrinks failures to the simplest example that fails
- Works with pytest, unittest and other runners
Who it's for
Python developers who want more coverage than hand-written examples give. Teams testing parsers, data code or algorithms often find it useful for catching surprising inputs.
Pricing and good to know
Hypothesis is free and open source. The project is on GitHub and published on PyPI, so it installs with pip. The team publishes a regular quarterly newsletter and blog articles about its development and the wider Hypothesis ecosystem.
Highlights
- Generates inputs from strategies you describe
- Finds edge cases you may not have thought of
- Shrinks failures to the simplest example
- Works with pytest, unittest and other runners












