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.
This releases adds support for type aliases created with the "type" statement (new in python 3.12) to "from_type()" and "register_type_strategy()".
This releases adds support for type aliases created with the "type" statement (new in python 3.12) to "from_type()" and "register_type_strategy()".
The canonical version of these notes (with links) is on readthedocs.
This releases adds support for type aliases created with the type statement (new in python 3.12) to ~hypothesis.strategies.from_type and ~hypothesis.strategies.register_type_strategy.
The Hypothesis database now supports a pub-sub interface to efficiently listen for changes in the database, via ".add_listener" and ".remove_listener"
The Hypothesis database now supports a pub-sub interface to efficiently listen for changes in the database, via ".add_listener" and ".remove_listener". While all databases that ship with Hypothesis support this interface, implementing it is not required for custom database subclasses. Hypothesis will warn when trying to listen on a database without support.
This feature is currently only used downstream in hypofuzz.
The canonical version of these notes (with links) is on readthedocs.
Your coding agent can read these notes before it upgrades. Set up the MCP server →
Improves sharing of some internal cache behavior.
Improves sharing of some internal cache behavior.
The canonical version of these notes (with links) is on readthedocs.
Optimize performance (improves speed by ~5%) and clarify the wording in an error message.
Optimize performance (improves speed by ~5%) and clarify the wording in an error message.
The canonical version of these notes (with links) is on readthedocs.
Optimize performance (improves speed by ~5%) and clarify the wording in an error message.
Fixes a bug since around version 6.124.4 where we might have generated "-0.0" for "st.floats(min_value=0.0)", which is unsound.
Fixes a bug since around version 6.124.4 where we might have generated "-0.0" for "st.floats(min_value=0.0)", which is unsound.
The canonical version of these notes (with links) is on readthedocs.
Fixes a bug since around version 6.124.4 where we might have generated -0.0 for st.floats(min_value=0.0), which is unsound.
Add 2024.12 to the list of recognized Array API versions in "hypothesis.extra.array_api".
Add 2024.12 to the list of recognized Array API versions in "hypothesis.extra.array_api".
The canonical version of these notes (with links) is on readthedocs.
Add 2024.12 to the list of recognized Array API versions in hypothesis.extra.array_api.
Registration of experimental Alternative backends for Hypothesis is now done via "hypothesis.internal.conjecture.providers.AVAILABLE_PROVIDERS" instea
Registration of experimental Alternative backends for Hypothesis is now done via "hypothesis.internal.conjecture.providers.AVAILABLE_PROVIDERS" instead of "hypothesis.internal.conjecture.data.AVAILABLE_PROVIDERS".
The canonical version of these notes (with links) is on readthedocs.
Registration of experimental alternative-backends is now done via hypothesis.internal.conjecture.providers.AVAILABLE_PROVIDERS instead of hypothesis.internal.conjecture.data.AVAILABLE_PROVIDERS.
Refactor some internals for better type hinting.
Refactor some internals for better type hinting.
The canonical version of these notes (with links) is on readthedocs.
*The canonical version of these notes (with links) is on readthedocs.*
Internal renamings.
The canonical version of these notes (with links) is on readthedocs.
More work on internal type hints.
More work on internal type hints.
The canonical version of these notes (with links) is on readthedocs.
Internal refactoring to make some stateful internals easier to access.
Internal refactoring to make some stateful internals easier to access.
The canonical version of these notes (with links) is on readthedocs.
Internal refactoring to make some stateful internals easier to access.
Refactoring of our internal input generation. This shouldn't lead to any changes in the distribution of test inputs. If you notice any, please open an
Refactoring of our internal input generation. This shouldn't lead to any changes in the distribution of test inputs. If you notice any, please open an issue!
The canonical version of these notes (with links) is on readthedocs.
Refactoring of our internal input generation. This shouldn't lead to any changes in the distribution of test inputs. If you notice any, please open an issue!
Some Hypothesis internals now use the number of choices as a yardstick of input size, rather than the entropy consumed by those choices. We don't expe
Some Hypothesis internals now use the number of choices as a yardstick of input size, rather than the entropy consumed by those choices. We don't expect this to cause significant behavioral changes.
The canonical version of these notes (with links) is on readthedocs.
Improves our internal caching logic for test cases.
Improves our internal caching logic for test cases.
The canonical version of these notes (with links) is on readthedocs.
fuzz_one_input is now implemented using an alternative backend. This brings the interpretation of the fuzzer-provided bytestring closer to the fuzzer
fuzz_one_input is now implemented using an alternative backend. This brings the interpretation of the fuzzer-provided bytestring closer to the fuzzer mutations, allowing the mutations to work more reliably. We hope to use this backend functionality to improve fuzzing integration (see e.g. https://github.com/google/atheris/issues/20) in the future!
The canonical version of these notes (with links) is on readthedocs.
fuzz_one_input is now implemented using an alternative backend. This brings the interpretation of the fuzzer-provided bytestring closer to the fuzzer mutations, allowing the mutations to work more reliably. We hope to use this backend functionality to improve fuzzing integration (e.g. atheris issue #20) in the future!
The Hypothesis example database now uses a new internal format to store examples. This new format is not compatible with the previous format, so store
The Hypothesis example database now uses a new internal format to store examples. This new format is not compatible with the previous format, so stored entries will not carry over.
The database is best thought of as a cache that may be invalidated at times. Instead of relying on it for correctness, we recommend using "@example" to specify explicit examples. When using databases across environments (such as connecting a "GitHubArtifactDatabase" database in CI to your local environment), we recommend using the same version of Hypothesis for each where possible, for maximum reproducibility.
The canonical version of these notes (with links) is on readthedocs.
This patch improves certain corner cases for reporting of flaky errors (issue #4183 and issue #4228).
This patch improves certain corner cases for reporting of flaky errors (issue #4183 and issue #4228).
The canonical version of these notes (with links) is on readthedocs.
This patch improves certain corner cases for reporting of flaky errors (4183 and 4228).
Improves an edge case in one of our integer and float shrinking passes.
Improves an edge case in one of our integer and float shrinking passes.
The canonical version of these notes (with links) is on readthedocs.
Improves an edge case in one of our integer and float shrinking passes.
Improves one of our shrinking passes for integers which require a constant relative difference to trigger the bug.
Improves one of our shrinking passes for integers which require a constant relative difference to trigger the bug.
The canonical version of these notes (with links) is on readthedocs.
Improves one of our shrinking passes for integers which require a constant relative difference to trigger the bug.
Avoid realizing symbolic values from Alternative backends for Hypothesis when "verbosity" is "verbose" or higher.
Avoid realizing symbolic values from Alternative backends for Hypothesis when "verbosity" is "verbose" or higher.
The canonical version of these notes (with links) is on readthedocs.
Avoid realizing symbolic values from alternative-backends when |Verbosity| is verbose or higher.
More internal code refactoring.
More internal code refactoring.
The canonical version of these notes (with links) is on readthedocs.
"DirectoryBasedExampleDatabase" now creates files representing database entries atomically, avoiding a very brief intermediary state where a file coul
"DirectoryBasedExampleDatabase" now creates files representing database entries atomically, avoiding a very brief intermediary state where a file could be created but not yet written to.
The canonical version of these notes (with links) is on readthedocs.
~hypothesis.database.DirectoryBasedExampleDatabase now creates files representing database entries atomically, avoiding a very brief intermediary state where a file could be created but not yet written to.
*The canonical version of these notes (with links) is on readthedocs.*
Internal code refactoring.
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.
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.
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.
One column per quarter.