NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #539 most downloaded on PyPI
The property-based testing library for Python
Last release 5 days ago
28 Sep 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
1571 releases · first in 2013
Fixes a bug caused by alternative backends raising "hypothesis.errors.BackendCannotProceed" in certain cases.
Fixes a bug caused by alternative backends raising "hypothesis.errors.BackendCannotProceed" in certain cases.
The canonical version of these notes (with links) is on readthedocs.
Fixes a bug caused by alternative backends raising hypothesis.errors.BackendCannotProceed in certain cases.
Add internal type hints to our pretty printer.
Add internal type hints to our pretty printer.
The canonical version of these notes (with links) is on readthedocs.
One column per quarter.
The shrinker contains a pass aimed at integers which are required to sum to a value. This patch extends that pass to floats as well.
The shrinker contains a pass aimed at integers which are required to sum to a value. This patch extends that pass to floats as well.
The canonical version of these notes (with links) is on readthedocs.
The shrinker contains a pass aimed at integers which are required to sum to a value. This patch extends that pass to floats as well.
Internal type hint additions and refactorings.
Internal type hint additions and refactorings.
The canonical version of these notes (with links) is on readthedocs.
"@reproduce_failure()" now uses a newer internal interface to represent failures. As a reminder, this representation is not intended to be stable acro
"@reproduce_failure()" now uses a newer internal interface to represent failures. As a reminder, this representation is not intended to be stable across versions or with respect to changes in the test.
The canonical version of these notes (with links) is on readthedocs.
Internal code refactoring for the typed choice sequence (issue #3921). May have some neutral effect on shrinking.
Internal code refactoring for the typed choice sequence (issue #3921). May have some neutral effect on shrinking.
The canonical version of these notes (with links) is on readthedocs.
Internal code refactoring for the typed choice sequence (3921). May have some neutral effect on shrinking.
This patch improves shrinking involving long strings or byte sequences whose value is not relevant to the failure.
This patch improves shrinking involving long strings or byte sequences whose value is not relevant to the failure.
The canonical version of these notes (with links) is on readthedocs.
This patch improves shrinking involving long strings or byte sequences whose value is not relevant to the failure.
This release further improves shrinking of strategies using "one_of()", allowing the shrinker to more reliably move between branches of the strategy.
This release further improves shrinking of strategies using "one_of()", allowing the shrinker to more reliably move between branches of the strategy.
The canonical version of these notes (with links) is on readthedocs.
This release further improves shrinking of strategies using ~hypothesis.strategies.one_of, allowing the shrinker to more reliably move between branches of the strategy.
The shrinker now uses the typed choice sequence (issue #3921) when ordering failing examples. As a result, Hypothesis may now report a different minim
The shrinker now uses the typed choice sequence (issue #3921) when ordering failing examples. As a result, Hypothesis may now report a different minimal failing example for some tests. We expect most cases to remain unchanged.
The canonical version of these notes (with links) is on readthedocs.
Our pytest plugin now emits a warning if you set Pytest's "norecursedirs" config option in such a way that the ".hypothesis" directory would be search
Our pytest plugin now emits a warning if you set Pytest's "norecursedirs" config option in such a way that the ".hypothesis" directory would be searched for tests. This reliably indicates that you've made a mistake which slows down test collection, usually assuming that your configuration extends the set of ignored patterns when it actually replaces them. (issue #4200)
The canonical version of these notes (with links) is on readthedocs.
"from_type()" can now handle constructors with required positional- only arguments if they have type annotations. Previously, we only passed arguments
"from_type()" can now handle constructors with required positional- only arguments if they have type annotations. Previously, we only passed arguments by keyword.
The canonical version of these notes (with links) is on readthedocs.
~hypothesis.strategies.from_type can now handle constructors with required positional-only arguments if they have type annotations. Previously, we only passed arguments by keyword.
This patch lays some groundwork for migrating our internal representation to the typed choice sequence (3921)
This patch lays some groundwork for migrating our internal representation to the typed choice sequence (3921)
This patch cleans up some internal code around clamping floats.
This patch cleans up some internal code around clamping floats.
This release improves shrinking in some cases, especially for strategies using ~hypothesis.strategies.one_of. This will typically improve shrinking sp
This release improves shrinking in some cases, especially for strategies using ~hypothesis.strategies.one_of. This will typically improve shrinking speed and may in some cases improve the end result.
This patch improves generation performance for the provisional ~hypothesis.provisional.domains strategy, including its derivative strategies ~hypothes
This patch improves generation performance for the provisional ~hypothesis.provisional.domains strategy, including its derivative strategies ~hypothesis.provisional.urls and ~hypothesis.strategies.emails.
This patch improves generation performance for the provisional domains() strategy, including its derivative strategies urls() and emails() .
This patch improves our error and warning messages.
This patch improves our error and warning messages.
Add a warning for st.text("ascii") - you probably meant st.text(st.characters(codec="ascii")). Similarly for "utf-8".
Recommend remedies in the error message of Unsatisfiable.
When @given errors because it was given an extra keyword argument, and the keyword matches a setting name like max_examples, recommend @settings(max_examples=...) instead.
This patch updates some outdated external links in our documentation.
This patch updates some outdated external links in our documentation.
Fix ~hypothesis.strategies.from_type on collections.abc.Callable returning None.
Fix ~hypothesis.strategies.from_type on collections.abc.Callable returning None.
This release adds .span_start() and .span_end() methods to our internal PrimitiveProvider interface, for use by alternative-backends.
This release adds .span_start() and .span_end() methods to our internal PrimitiveProvider interface, for use by alternative-backends.
This release adds .span_start() and .span_end() methods to our internal PrimitiveProvider interface, for use by Alternative backends for Hypothesis .
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 release brings back the old representation of hypothesis.stateful.Bundle, reverting most changes of PR #4124 _.
This release brings back the old representation of hypothesis.stateful.Bundle, reverting most changes of PR #4124.
This release adds ~hypothesis.database.BackgroundWriteDatabase, a new database backend which defers writes on the wrapped database to a background thr
This release adds ~hypothesis.database.BackgroundWriteDatabase, a new database backend which defers writes on the wrapped database to a background thread. This allows for low-overhead writes in performance-critical environments like fuzz_one_input.
This release changes our input distribution for low max_examples. Previously, we capped the size of inputs when generating at least the first 10 input
This release changes our input distribution for low max_examples. Previously, we capped the size of inputs when generating at least the first 10 inputs, with the reasoning that early inputs to a property should be small. However, this meant properties with max_examples=10 would consistent entirely of small inputs. This patch removes the hard lower bound so that inputs to these properties are more representative of the input space.
When a user requests an interactive input via strategy.example, we generate and cache a batch of 100 inputs, returning the first one. This can be expensive for large strategies or when only a few examples are needed. This release improves the speed of strategy.example by lowering the batch size to 10.
This patch fixes a bug since v6.99.13 where only interactively-generated values (via data.draw) would be reported in the arguments field of our observ
This patch fixes a bug since v6.99.13 where only interactively-generated values (via data.draw) would be reported in the arguments field of our observability output. Now, all values are reported.
This patch fixes a bug since 6.99.13 - 2024-03-24 where only interactively-generated values (via data.draw ) would be reported in the arguments field of our observability output . Now, all values are reported.
Hypothesis collects coverage information during the |Phase.shrink| and |Phase.explain| phases in order to show a more informative error message. On 3.
Hypothesis collects coverage information during the |Phase.shrink| and |Phase.explain| phases in order to show a more informative error message. On 3.12+, this uses sys.monitoring. This patch improves the performance of coverage collection on 3.12+ by disabling events we don't need.
This patch refactors some internals to prepare for future work using our IR (3921).
This patch refactors some internals to prepare for future work using our IR (3921).
This patch migrates some more internals (around generating novel inputs) to the IR layer (3921).
This patch migrates some more internals (around generating novel inputs) to the IR layer (3921).
This release improves Hypothesis' handling of ExceptionGroup - it's now able to detect marker detections if they're inside a group and attempts to res
This release improves Hypothesis' handling of ExceptionGroup - it's now able to detect marker detections if they're inside a group and attempts to resolve them. Note that this handling is still a work in progress and might not handle edge cases optimally. Please open issues if you encounter any problems or unexpected behavior with it.
Internal refactorings in preparation for upcoming changes.
Internal refactorings in preparation for upcoming changes.
Internal renamings. .. _v6.118.7: --------------------
This patch removes some # type: ignore comments following a mypy update.
This patch removes some # type: ignore comments following a mypy update.
When Hypothesis replays examples from its test database that it knows were previously fully shrunk it will no longer try to shrink them again.
When Hypothesis replays examples from its test database that it knows were previously fully shrunk it will no longer try to shrink them again.
This should significantly speed up development workflows for slow tests, as the shrinking could contribute a significant delay when rerunning the tests.
In some rare cases this may cause minor reductions in example quality. This was considered an acceptable tradeoff for the improved test runtime.
This patch avoids computing some string representations we won't need, giving a small speedup (part of 4139).
This patch avoids computing some string representations we won't need, giving a small speedup (part of 4139).
This patch migrates the optimisation algorithm for targeted property-based testing to our IR layer (3921). This should result in moderately different
This patch migrates the optimisation algorithm for targeted property-based testing to our IR layer (3921). This should result in moderately different (and hopefully improved) exploration behavior in tests which use hypothesis.target.
This patch adds more type hints to internal Hypothesis code.
This patch adds more type hints to internal Hypothesis code.
This patch migrates the |Phase.explain| phase to our IR layer (3921). This should improve both its speed and precision.
This patch migrates the |Phase.explain| phase to our IR layer (3921). This should improve both its speed and precision.
This patch updates some internals around how we determine an input is too large to finish generating.
This patch updates some internals around how we determine an input is too large to finish generating.
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.
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() .
Your coding agent can read these notes before it upgrades. Set up the MCP server →