NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI, #384 most downloaded on PyPI
The property-based testing library for Python
Latest stable
6.170.15
Last release 11 days ago
06 Nov 2026
Ships on a steady schedule
a new release about every 9 days
Nearly every release is documented
notes for 60 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
14 years old
1594 releases · first in 2013
Drag across the ruler to compare, or tap a release to open it.
The ~hypothesis.provisional.urls strategy no longer generates URLs where the port number is 0.
The ~hypothesis.provisional.urls strategy no longer generates URLs where the port number is 0.
This change is motivated by the idea that the generated URLs should, at least in theory, be possible to fetch. The port number 0 is special; if a server binds to port 0, the kernel will allocate an unused, and non-zero, port instead. That means that it's not possible for a server to actually be listening on port 0. This motivation is briefly described in the documentation for ~hypothesis.provisional.urls.
Thanks to @gmacon for fixing 4157!
This changes the behaviour of settings profiles so that if you reregister the currently loaded profile it will automatically reload it. Previously you
This changes the behaviour of settings profiles so that if you reregister the currently loaded profile it will automatically reload it. Previously you would have had to load it again.
In particular this means that if you register a "ci" profile, it will automatically be used when Hypothesis detects you are running on CI.
Your coding agent can read these notes before it upgrades. Set up the MCP server →
Hypothesis now detects if it is running on a CI server and provides better default settings for running on CI in this case.
Hypothesis now detects if it is running on a CI server and provides better default settings for running on CI in this case.
This patch changes the priority order of pretty printing logic so that a user provided pretty printing method will always be used in preference to e.g
This patch changes the priority order of pretty printing logic so that a user provided pretty printing method will always be used in preference to e.g. printing it like a dataclass.
This patch restores diversity to the outputs of from_type(type) (4144).
This patch restores diversity to the outputs of from_type(type) (4144).
This release improves pretty printing of nested classes to include the outer class name in their printed representation.
This release improves pretty printing of nested classes to include the outer class name in their printed representation.
This patch fixes a regression from version 6.115.2 where generating values from ~hypothesis.strategies.integers with certain values for min_value and
This patch fixes a regression from version 6.115.2 where generating values from ~hypothesis.strategies.integers with certain values for min_value and max_value would error.
…weights parameter to draw_integer and may be a breaking change for you.
This release improves integer shrinking by folding the endpoint upweighting for ~hypothesis.strategies.integers into the weights parameter of our IR (3921).
If you maintain an alternative backend as part of our (for now explicitly unstable) alternative-backends, this release changes the type of the weights parameter to draw_integer and may be a breaking change for you.
This release improves integer shrinking by folding the endpoint upweighting for integers() into the weights parameter of our IR ( issue #3921 ).
If you maintain an alternative backend as part of our (for now explicitly unstable) Alternative backends for Hypothesis , this release changes the type of the weights parameter to draw_integer and may be a breaking change for you.
This patch improves the performance of ~hypothesis.strategies.from_type with pydantic.types.condate __ (4000).
This patch improves the performance of ~hypothesis.strategies.from_type with pydantic.types.condate (4000).
This patch improves the performance of from_type() with pydantic.types.condate ( issue #4000 ).
This improves the formatting of dataclasses and attrs classes when printing falsifying examples.
This improves the formatting of dataclasses and attrs classes when printing falsifying examples.
This patch upgrades remaining type annotations to Python 3.9 syntax.
This patch upgrades remaining type annotations to Python 3.9 syntax.
This release drops support for Python 3.8, which reached end of life on 2024-10-07 __.
This release drops support for Python 3.8, which reached end of life on 2024-10-07.
This release adds hypothesis.errors.BackendCannotProceed, an unstable API for use by alternative-backends.
This release adds hypothesis.errors.BackendCannotProceed, an unstable API for use by alternative-backends.
This release adds hypothesis.errors.BackendCannotProceed , an unstable API for use by Alternative backends for Hypothesis .
This release fixes a regression where hypothesis.stateful.Bundle did not work properly with |.flatmap| functionality (4128).
This release fixes a regression where hypothesis.stateful.Bundle did not work properly with |.flatmap| functionality (4128).
This patch tweaks the paths in @example(...) patches, so that both git apply and patch will work by default.
This patch tweaks the paths in @example(...) patches, so that both git apply and patch will work by default.
This release refactors internals of hypothesis.stateful.Bundle to have a more consistent representation internally.
This release refactors internals of hypothesis.stateful.Bundle to have a more consistent representation internally.
This patch fixes an internal error when the __context__ attribute of a raised exception leads to a cycle (4115).
This patch fixes an internal error when the __context__ attribute of a raised exception leads to a cycle (4115).
This patch removes a now-incorrect internal assertion about numpy's typing after recent numpy changes (currently only in numpy's nightly release).
This patch removes a now-incorrect internal assertion about numpy's typing after recent numpy changes (currently only in numpy's nightly release).
…changes the draw_* interface and may be a breaking change for you.
This release adds support for variable-width bytes in our IR layer (3921), which should mean improved performance anywhere you use ~hypothesis.strategies.binary. If you maintain an alternative backend as part of our (for now explicitly unstable) alternative-backends, this release changes the draw_* interface and may be a breaking change for you.
This release adds support for variable-width bytes in our IR layer ( issue #3921 ), which should mean improved performance anywhere you use binary() . If you maintain an alternative backend as part of our (for now explicitly unstable) Alternative backends for Hypothesis , this release changes the draw_* interface and may be a breaking change for you.
This patch contains some internal code cleanup. There is no user-visible change.
This patch contains some internal code cleanup. There is no user-visible change.
This patch improves shrinking in cases involving 'slips' from one strategy to another. Highly composite strategies are the most likely to benefit from
This patch improves shrinking in cases involving 'slips' from one strategy to another. Highly composite strategies are the most likely to benefit from this change.
This patch also reduces the range of python:datetime.datetime generated by ~hypothesis.extra.django.from_model in order to avoid https://code.djangoproject.com/ticket/35683.
alternative-backends can now implement .observe_test_case() and observe_information_message() methods, to record backend-specific metadata and message
alternative-backends can now implement .observe_test_case() and observe_information_message() methods, to record backend-specific metadata and messages in our observability output (3845 and hypothesis-crosshair#22).
Alternative backends for Hypothesis can now implement .observe_test_case() and observe_information_message() methods, to record backend-specific metadata and messages in our observability output ( issue #3845 and hypothesis-crosshair#22 ).
Support __default__ field of ~python:typing.TypeVar and support the same from typing-extensions in ~hypothesis.strategies.from_type.
Support __default__ field of ~python:typing.TypeVar and support the same from typing-extensions in ~hypothesis.strategies.from_type.
Support default field of TypeVar and support the same from typing-extensions in from_type() .
Add better error message for ~python:typing.TypeIs types in ~hypothesis.strategies.from_type.
Add better error message for ~python:typing.TypeIs types in ~hypothesis.strategies.from_type.
Support ~python:typing.LiteralString in ~hypothesis.strategies.from_type.
Support ~python:typing.LiteralString in ~hypothesis.strategies.from_type.
This patch makes progress towards adding type hints to our internal conjecture engine (3074).
This patch makes progress towards adding type hints to our internal conjecture engine (3074).
This release allows using ~python:typing.Annotated and !ReadOnly types for ~python:typing.TypedDict value types with ~hypothesis.strategies.from_type.
This release allows using ~python:typing.Annotated and !ReadOnly types for ~python:typing.TypedDict value types with ~hypothesis.strategies.from_type.
This release allows using Annotated and ReadOnly types for TypedDict value types with from_type() .
This patch fixes compatibility with attrs==24.1.0 on the nightly build of CPython, 3.14.0 pre-alpha (4067).
This patch fixes compatibility with attrs==24.1.0 on the nightly build of CPython, 3.14.0 pre-alpha (4067).
This patch removes an assertion which was in fact possible in rare circumstances involving a small number of very large draws.
This patch removes an assertion which was in fact possible in rare circumstances involving a small number of very large draws.
This patch improves our example generation performance by adjusting our internal cache implementation.
This patch improves our example generation performance by adjusting our internal cache implementation.
This patch improves our pretty-printer for unusual numbers.
This patch improves our pretty-printer for unusual numbers.
Signalling NaNs are now represented by using the struct module to show the exact value by converting from a hexadecimal integer
CPython limits integer-to-string conversions to mitigate DDOS attacks. We now use hexadecimal for very large integers, and include underscore separators for integers with ten or more digits.
This patch improves generation speed in some cases by avoiding pretty-printing overhead for non-failing examples.
This patch improves generation speed in some cases by avoiding pretty-printing overhead for non-failing examples.
This patch fixes a rare internal error when using ~hypothesis.strategies.integers with a high number of examples and certain {min, max}_value paramete
This patch fixes a rare internal error when using ~hypothesis.strategies.integers with a high number of examples and certain {min, max}_value parameters (4059).
This patch addresses the issue of hypothesis potentially accessing mocked time.perf_counter during test execution (4051).
This patch addresses the issue of hypothesis potentially accessing mocked time.perf_counter during test execution (4051).
Minor internal-only cleanups to some error-handling and reporting code.
Minor internal-only cleanups to some error-handling and reporting code.
This patch disables hypothesis.target on alternative backends where it would not work.
This patch disables hypothesis.target on alternative backends where it would not work.
This patch updates our vendored list of top-level domains __, which is used by the provisional ~hypothesis.provisional.domains strategy.
This patch updates our vendored list of top-level domains, which is used by the provisional ~hypothesis.provisional.domains strategy.
This patch changes most Flaky errors to use an ExceptionGroup, which makes the representation of these errors easier to understand.
This patch changes most Flaky errors to use an ExceptionGroup, which makes the representation of these errors easier to understand.
The alphabet= argument to ~hypothesis.strategies.from_regex now accepts unions of ~hypothesis.strategies.characters and ~hypothesis.strategies.sampled
The alphabet= argument to ~hypothesis.strategies.from_regex now accepts unions of ~hypothesis.strategies.characters and ~hypothesis.strategies.sampled_from strategies, in addition to accepting each individually.
This patch also fixes a bug where text(...).filter(re.compile(...).match) could generate non-matching instances if the regex pattern contained | (4008).
The alphabet= argument to from_regex() now accepts unions of characters() and sampled_from() strategies, in addition to accepting each individually.
This patch also fixes a bug where text(...).filter(re.compile(...).match) could generate non-matching instances if the regex pattern contained | ( issue #4008 ).
This patch improves our pretty-printer (4037).
This patch improves our pretty-printer (4037).
It also fixes the codemod for HealthCheck.all() from version 6.72, which was instead trying to fix Healthcheck.all() - note the lower-case c! Since our tests had the same typo, it all looked good... until 4030.
This release improves support for unions of numpy dtypes such as np.float64 | np.complex128 in ~hypothesis.strategies.from_type and ~hypothesis.extra.
This release improves support for unions of numpy dtypes such as np.float64 | np.complex128 in ~hypothesis.strategies.from_type and ~hypothesis.extra.numpy.arrays (4041).
This release improves support for unions of numpy dtypes such as np.float64 | np.complex128 in from_type() and arrays() ( issue #4041 ).
This patch improves the reporting of certain flaky errors.
This patch improves the reporting of certain flaky errors.
This patch iterates on our experimental support for alternative backends (alternative-backends). See 4029 for details.
This patch iterates on our experimental support for alternative backends (alternative-backends). See 4029 for details.
This patch iterates on our experimental support for alternative backends ( Alternative backends for Hypothesis ). See pull request #4029 for details.
This release improves support for Django 5.0, and drops support for end-of-life Django versions (< 4.2).
This release improves support for Django 5.0, and drops support for end-of-life Django versions (< 4.2).
Thanks to Joshua Munn for this contribution.
Clean up internal cache implementation.
Clean up internal cache implementation.
This patch updates our autoformatting tools, improving our code style without any API changes.
This patch updates our autoformatting tools, improving our code style without any API changes.
This patch fixes an issue when realizing symbolics with our experimental ~hypothesis.settings.backend setting.
This patch fixes an issue when realizing symbolics with our experimental ~hypothesis.settings.backend setting.
This patch fixes an issue when realizing symbolics with our experimental backend setting.
Improves internal test coverage.
Improves internal test coverage.
This release adds strategies for Django's ModelChoiceField and ModelMultipleChoiceField (4010).
This release adds strategies for Django's ModelChoiceField and ModelMultipleChoiceField (4010).
Thanks to Joshua Munn for this contribution.
Fixes and reinstates full coverage of internal tests, which was accidentally disabled in 3935 (4003).
Fixes and reinstates full coverage of internal tests, which was accidentally disabled in 3935 (4003).
This release prevents a race condition inside internal cache implementation.
This release prevents a race condition inside internal cache implementation.
This patch updates our vendored list of top-level domains __, which is used by the provisional ~hypothesis.provisional.domains strategy.
This patch updates our vendored list of top-level domains, which is used by the provisional ~hypothesis.provisional.domains strategy.
This patch improves our deduplication tracking across all strategies (4007). Hypothesis is now less likely to generate the same input twice.
This patch improves our deduplication tracking across all strategies (4007). Hypothesis is now less likely to generate the same input twice.
Account for time spent in garbage collection during tests, to avoid flaky DeadlineExceeded errors as seen in 3975.
Account for time spent in garbage collection during tests, to avoid flaky DeadlineExceeded errors as seen in 3975.
Also fixes overcounting of stateful run times, a minor observability bug dating to version 6.98.9 (3890).
This release migrates the shrinker to our new internal representation, called the IR layer (3962). This improves the shrinker's performance in the maj
This release migrates the shrinker to our new internal representation, called the IR layer (3962). This improves the shrinker's performance in the majority of cases. For example, on the Hypothesis test suite, shrinking is a median of 1.38x faster.
It is possible this release regresses performance while shrinking certain strategies. If you encounter strategies which reliably shrink more slowly than they used to (or shrink slowly at all), please open an issue!
You can read more about the IR layer at 3921.
This patch fixes one of our shrinking passes getting into a rare O(n) case instead of O(log(n)).
This patch fixes one of our shrinking passes getting into a rare O(n) case instead of O(log(n)).
This patch fixes some introspection errors new in Python 3.11.9 and 3.13.0b1, for the Ghostwriter and ~hypothesis.strategies.from_type.
This patch fixes some introspection errors new in Python 3.11.9 and 3.13.0b1, for the Ghostwriter and ~hypothesis.strategies.from_type.
Internal developer documentation, no user-visible changes.
Internal developer documentation, no user-visible changes.
This patch improves our shrinking of unique collections, such as ~hypothesis.strategies.dictionaries, ~hypothesis.strategies.sets, and ~hypothesis.str
This patch improves our shrinking of unique collections, such as ~hypothesis.strategies.dictionaries, ~hypothesis.strategies.sets, and ~hypothesis.strategies.lists with unique=True.
This patch improves our shrinking of unique collections, such as dictionaries() , sets() , and lists() with unique=True .
This patch fixes a rare internal error when generating very large elements from strategies (3874).
This patch fixes a rare internal error when generating very large elements from strategies (3874).
One column per quarter.