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 3 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
"from_type()" now correctly handles annotated-types annotations on "typing.TypedDict" fields which are also marked as being "ReadOnly", "Required", or
"from_type()" now correctly handles annotated-types annotations on "typing.TypedDict" fields which are also marked as being "ReadOnly", "Required", or "NotRequired" (issue #4474).
The canonical version of these notes (with links) is on readthedocs.
~hypothesis.strategies.from_type now correctly handles annotated-types annotations on typing.TypedDict fields which are also marked as being ~typing.ReadOnly, ~typing.Required, or ~typing.NotRequired (4474).
The extras for NumPy and pandas now support automatically inferring a strategy for "dtype="O"". Previously, Hypothesis required an explicit elements s
One column per quarter.
The extras for NumPy and pandas now support automatically inferring a strategy for "dtype="O"". Previously, Hypothesis required an explicit elements strategy to be passed, for example "nps.arrays("O", shape=(1,), elements=st.just(object()))". Now, Hypothesis automatically infers "elements=st.from_type(object)".
Thanks to Shaun Read for identifying and fixing this!
The canonical version of these notes (with links) is on readthedocs.
The extras for |hypothesis-numpy| and |hypothesis-pandas| now support automatically inferring a strategy for dtype="O". Previously, Hypothesis required an explicit elements strategy to be passed, for example nps.arrays("O", shape=(1,), elements=st.just(object())). Now, Hypothesis automatically infers elements=st.from_type(object).
Thanks to Shaun Read for identifying and fixing this!
This patch fixes "binary_operation()" to include imports for "hypothesis.extra.numpy" strategies such as "arrays()", "scalar_dtypes()", and "array_sha
This patch fixes "binary_operation()" to include imports for "hypothesis.extra.numpy" strategies such as "arrays()", "scalar_dtypes()", and "array_shapes()" when ghostwriting tests for functions with numpy array parameters (issue #4576).
The canonical version of these notes (with links) is on readthedocs.
This patch fixes ~hypothesis.extra.ghostwriter.binary_operation to include imports for hypothesis.extra.numpy strategies such as ~hypothesis.extra.numpy.arrays, ~hypothesis.extra.numpy.scalar_dtypes, and ~hypothesis.extra.numpy.array_shapes when ghostwriting tests for functions with numpy array parameters (4576).
Improve the accuracy of test timing reports, by tracking the start time of each test case closer to when the test is executed.
Improve the accuracy of test timing reports, by tracking the start time of each test case closer to when the test is executed.
The canonical version of these notes (with links) is on readthedocs.
Improve the accuracy of test timing reports, by tracking the start time of each test case closer to when the test is executed.
Fix a recursion error when observability is enabled and a test generates an object with a recursive reference, like "a = []; a.append(a)".
Fix a recursion error when observability is enabled and a test generates an object with a recursive reference, like "a = []; a.append(a)".
The canonical version of these notes (with links) is on readthedocs.
Fix a recursion error when observability is enabled and a test generates an object with a recursive reference, like a = []; a.append(a).
Remove a case where Hypothesis would interact with the global "random.Random" instance if Hypothesis internals were used directly.
Remove a case where Hypothesis would interact with the global "random.Random" instance if Hypothesis internals were used directly.
The canonical version of these notes (with links) is on readthedocs.
Remove a case where Hypothesis would interact with the global |random.Random| instance if Hypothesis internals were used directly.
Simplify some internal typing logic after dropping Python 3.9.
Simplify some internal typing logic after dropping Python 3.9.
The canonical version of these notes (with links) is on readthedocs.
This release drops support for Python 3.9, which reached end of life in October 2025.
This release drops support for Python 3.9, which reached end of life in October 2025.
The canonical version of these notes (with links) is on readthedocs.
This release drops support for Python 3.9, which reached end of life in October 2025.
Fixes an error when using the Ghostwriter with annotations that include "typing.ForwardRef" on Python 3.14 (issue #4565).
Fixes an error when using the Ghostwriter with annotations that include "typing.ForwardRef" on Python 3.14 (issue #4565).
The canonical version of these notes (with links) is on readthedocs.
Fixes an error when using the Ghostwriter with annotations that include python:typing.ForwardRef on Python 3.14 (4565).
The "from_field()" and "from_form()" strategies from our Django extra now support "FileField".
The "from_field()" and "from_form()" strategies from our Django extra now support "FileField".
Thanks to Arjoonn Sharma for this fix!
The canonical version of these notes (with links) is on readthedocs.
The |django.from_field| and |django.from_form| strategies from our Django extra now support ~django:django.db.models.FileField.
Thanks to Arjoonn Sharma for this fix!
Clean up internal "@overload" type annotations.
Clean up internal "@overload" type annotations.
The canonical version of these notes (with links) is on readthedocs.
Fixes our bundled "run_conformance_test()" not respecting "avoid_realization".
Fixes our bundled "run_conformance_test()" not respecting "avoid_realization".
The canonical version of these notes (with links) is on readthedocs.
Fixes our bundled |run_conformance_test| not respecting |PrimitiveProvider.avoid_realization|.
The automatic switch to the CI "settings profile" now works under tox (for "tox >= 4.30.0").
The automatic switch to the CI "settings profile" now works under tox (for "tox >= 4.30.0").
The canonical version of these notes (with links) is on readthedocs.
The automatic switch to the CI settings profile now works under tox (for tox >= 4.30.0).
This patch re-enables the warning for incompatible "shared()" strategies that was first enabled in v6.133.0 but disabled in v6.135.15.
This patch re-enables the warning for incompatible "shared()" strategies that was first enabled in v6.133.0 but disabled in v6.135.15.
The canonical version of these notes (with links) is on readthedocs.
This patch re-enables the warning for incompatible ~hypothesis.strategies.shared strategies that was first enabled in 6.133.0 but disabled in 6.135.15.
"characters()" now validates that the elements of the "exclude_characters" and "include_characters" arguments are single characters, which was always
"characters()" now validates that the elements of the "exclude_characters" and "include_characters" arguments are single characters, which was always assumed internally. For example, "exclude_characters=["a", "b"]" is valid while "exclude_characters=["ab"]" will now raise an error up-front.
The canonical version of these notes (with links) is on readthedocs.
Add "phase" to the hypothesis-specific metadata in observability.
Add "phase" to the hypothesis-specific metadata in observability.
The canonical version of these notes (with links) is on readthedocs.
Internal refactoring for new lint rules.
Internal refactoring for new lint rules.
The canonical version of these notes (with links) is on readthedocs.
Fixed another typo in error message around function-scoped fixtures.
Fixed another typo in error message around function-scoped fixtures.
The canonical version of these notes (with links) is on readthedocs.
Add "get_current_profile_name()", which returns the name of the current settings profile.
Add "get_current_profile_name()", which returns the name of the current settings profile.
The canonical version of these notes (with links) is on readthedocs.
Add |settings.get_current_profile_name|, which returns the name of the current settings profile.
Fixed typo in error message around function-scoped fixtures.
Fixed typo in error message around function-scoped fixtures.
The canonical version of these notes (with links) is on readthedocs.
Improved error message for "DeadlineExceeded".
Improved error message for "DeadlineExceeded".
The canonical version of these notes (with links) is on readthedocs.
Refactor some stateful testing internals for easier use by third-party libraries.
Refactor some stateful testing internals for easier use by third-party libraries.
The canonical version of these notes (with links) is on readthedocs.
Refactor some stateful testing internals for easier use by third-party libraries.
Patch files written by hypothesis now use a deterministic ordering when multiple "@example" decorators are present.
Patch files written by hypothesis now use a deterministic ordering when multiple "@example" decorators are present.
The canonical version of these notes (with links) is on readthedocs.
Patch files written by hypothesis now use a deterministic ordering when multiple |@example| decorators are present.
Fix a typo affecting pretty-printing of lambdas with complex default arguments.
Fix a typo affecting pretty-printing of lambdas with complex default arguments.
The canonical version of these notes (with links) is on readthedocs.
Fix a typo affecting pretty-printing of lambdas with complex default arguments.
Improve automatic detection of the CI profile on various vendor- specific CI systems.
Improve automatic detection of the CI profile on various vendor- specific CI systems.
The canonical version of these notes (with links) is on readthedocs.
Improve automatic detection of the CI profile on various vendor-specific CI systems.
This patch updates our vendored list of top-level domains, which is used by the provisional "domains()" strategy.
This patch updates our vendored list of top-level domains, which is used by the provisional "domains()" strategy.
The canonical version of these notes (with links) is on readthedocs.
This patch updates our vendored list of top-level domains, which is used by the provisional ~hypothesis.provisional.domains strategy.
Internal refactor to simplify "SearchStrategy".
Internal refactor to simplify "SearchStrategy".
The canonical version of these notes (with links) is on readthedocs.
This patch further improves stringification of lambdas, by never returning a lambda source unless it is confirmed to compile to the same code object.
This patch further improves stringification of lambdas, by never returning a lambda source unless it is confirmed to compile to the same code object. This stricter check makes it possible to widen the search for a matching source block, so that it can often be found even if the file has been edited.
The canonical version of these notes (with links) is on readthedocs.
Fixes a race condition under threading when using "deferred()".
Fixes a race condition under threading when using "deferred()".
The canonical version of these notes (with links) is on readthedocs.
Improves upon the cache eviction problem workaround of v6.135.12.
Improves upon the cache eviction problem workaround of v6.135.12.
The canonical version of these notes (with links) is on readthedocs.
*The canonical version of these notes (with links) is on readthedocs.*
Documentation tweaks.
The canonical version of these notes (with links) is on readthedocs.
Fixes a race condition under threading for strategies which trigger our filter-rewriting rules, like "st.integers().filter(lambda x: abs(x) > 100)".
Fixes a race condition under threading for strategies which trigger our filter-rewriting rules, like "st.integers().filter(lambda x: abs(x) > 100)".
The canonical version of these notes (with links) is on readthedocs.
Fixes a race condition under threading for strategies which trigger our filter-rewriting rules, like st.integers().filter(lambda x: abs(x) > 100).
One of our shrinking passes for reducing failing inputs targets failures which require two numbers to add to the same value. This pass previously only
One of our shrinking passes for reducing failing inputs targets failures which require two numbers to add to the same value. This pass previously only worked for positive numbers. This patch fixes that, so it also works for negative numbers.
The canonical version of these notes (with links) is on readthedocs.
This patch slightly improves the cache-hit rate for "dictionaries()" and certain unique "lists()".
This patch slightly improves the cache-hit rate for "dictionaries()" and certain unique "lists()".
The canonical version of these notes (with links) is on readthedocs.
This patch slightly improves the cache-hit rate for |st.dictionaries| and certain unique |st.lists|.
The type annotations for "register_type_strategy()" now indicate that it accepts registering types created with "typing.TypeAliasType" (aka "type MyTy
The type annotations for "register_type_strategy()" now indicate that it accepts registering types created with "typing.TypeAliasType" (aka "type MyType = int").
The canonical version of these notes (with links) is on readthedocs.
The type annotations for |st.register_type_strategy| now indicate that it accepts registering types created with |TypeAliasType| (aka type MyType = int).
Internal refactoring and cleanup. As a result, "hypothesis[black]" now requires "black>=20.8b0" instead of the previous "black>=19.10b0".
Internal refactoring and cleanup. As a result, "hypothesis[black]" now requires "black>=20.8b0" instead of the previous "black>=19.10b0".
The canonical version of these notes (with links) is on readthedocs.
Internal refactoring and cleanup. As a result, hypothesis[cli] and hypothesis[ghostwriter] now require black>=20.8b0 instead of the previous black>=19.10b0.
On Python 3.14, "memoryview" is newly generic. This release adds the ability for "from_type()" to resolve generic "memoryview" types on 3.14, like "st
On Python 3.14, "memoryview" is newly generic. This release adds the ability for "from_type()" to resolve generic "memoryview" types on 3.14, like "st.from_type(memoryview[CustomBufferClass])" . "CustomBufferClass" must implement "buffer", as expected by "memoryview".
The canonical version of these notes (with links) is on readthedocs.
On Python 3.14, |memoryview| is newly generic. This release adds the ability for |st.from_type| to resolve generic |memoryview| types on 3.14, like st.from_type(memoryview[CustomBufferClass]) . CustomBufferClass must implement __buffer__, as expected by |memoryview|.
This patch makes the stringification of lambdas, and as a result certain automatic filter rewriting operations, more robust. This fixes issue #4498, w
This patch makes the stringification of lambdas, and as a result certain automatic filter rewriting operations, more robust. This fixes issue #4498, where a lambda was mistakenly identified as the identity operator due to "inspect.getsource()" only returning the first line of the lambda definition.
As a result, the "repr" of strategies filtered or mapped by lambda functions may change slightly.
The canonical version of these notes (with links) is on readthedocs.
Add support for Python 3.14, which is currently in release candidate 1.
Add support for Python 3.14, which is currently in release candidate 1.
The canonical version of these notes (with links) is on readthedocs.
Add support for Python 3.14, which is currently in release candidate 1.
Fixes a bug with solver-based alternative backends (like crosshair) where symbolic values passed to "event()" would not be realized to concrete values
Fixes a bug with solver-based alternative backends (like crosshair) where symbolic values passed to "event()" would not be realized to concrete values at the end of the test case.
The canonical version of these notes (with links) is on readthedocs.
The previous "TESTCASE_CALLBACKS" is deprecated.
Add the "add_observability_callback", "remove_observability_callback", "with_observability_callback", and "observability_enabled" methods to the observability interface. The previous "TESTCASE_CALLBACKS" is deprecated.
This release also adds better threading support to observability callbacks. An observability callback will now only be called for observations generated by the same thread.
The canonical version of these notes (with links) is on readthedocs.
Fix a threading race condition in "one_of()" initialization.
Fix a threading race condition in "one_of()" initialization.
The canonical version of these notes (with links) is on readthedocs.
Improve the error messages and documentation for "HealthCheck". Among others, the messaging is now more clear that health checks are proactive warning
Improve the error messages and documentation for "HealthCheck". Among others, the messaging is now more clear that health checks are proactive warnings, not correctness errors.
The canonical version of these notes (with links) is on readthedocs.
Improve the error messages and documentation for |HealthCheck|. Among others, the messaging is now more clear that health checks are proactive warnings, not correctness errors.
Improve detection of sys.monitoring to avoid errors on GraalPy.
Improve detection of sys.monitoring to avoid errors on GraalPy.
The canonical version of these notes (with links) is on readthedocs.
When a test is executed concurrently from multiple threads, "HealthCheck.too_slow" is now disabled, since the Python runtime may decide to switch away
When a test is executed concurrently from multiple threads, "HealthCheck.too_slow" is now disabled, since the Python runtime may decide to switch away from a thread for arbitrarily long and Hypothesis cannot track execution time per-thread.
The canonical version of these notes (with links) is on readthedocs.
This patch updates our vendored list of top-level domains, which is used by the provisional "domains()" strategy.
This patch updates our vendored list of top-level domains, which is used by the provisional "domains()" strategy.
The canonical version of these notes (with links) is on readthedocs.
This patch updates our vendored list of top-level domains, which is used by the provisional ~hypothesis.provisional.domains strategy.
"HealthCheck.differing_executors" is no longer raised if a test is executed by different executors from different threads. "HealthCheck.differing_exec
"HealthCheck.differing_executors" is no longer raised if a test is executed by different executors from different threads. "HealthCheck.differing_executors" will still be raised if a test is executed by different executors in the same thread.
The canonical version of these notes (with links) is on readthedocs.
When a test is executed concurrently from multiple threads, "DeadlineExceeded" is now disabled, since the Python runtime may decide to switch away fro
When a test is executed concurrently from multiple threads, "DeadlineExceeded" is now disabled, since the Python runtime may decide to switch away from a thread for longer than "settings.deadline", and Hypothesis cannot track execution time per- thread. See issue #4478.
The canonical version of these notes (with links) is on readthedocs.
"@precondition" now errors if used without "@rule" or "@invariant". Doing so has no effect and is indicative of a user error (issue
"@precondition" now errors if used without "@rule" or "@invariant". Doing so has no effect and is indicative of a user error (issue #4413).
The canonical version of these notes (with links) is on readthedocs.
|@precondition| now errors if used without |@rule| or |@invariant|. Doing so has no effect and is indicative of a user error (4413).
Fix "on_observation()" being called with observations it wasn't responsible for generating if the test failed.
Fix "on_observation()" being called with observations it wasn't responsible for generating if the test failed.
The canonical version of these notes (with links) is on readthedocs.
Fix |PrimitiveProvider.on_observation| being called with observations it wasn't responsible for generating if the test failed.
When a failure found by an alternative backend does not reproduce under the Hypothesis backend, we now raise "FlakyBackendFailure" instead of an inter
When a failure found by an alternative backend does not reproduce under the Hypothesis backend, we now raise "FlakyBackendFailure" instead of an internal "FlakyReplay" exception.
The canonical version of these notes (with links) is on readthedocs.
When a failure found by an alternative backend does not reproduce under the Hypothesis backend, we now raise |FlakyBackendFailure| instead of an internal FlakyReplay exception.
Speculative fix for a thread-safety issue in calculating strategy labels.
Speculative fix for a thread-safety issue in calculating strategy labels.
The canonical version of these notes (with links) is on readthedocs.
Speculative fix for a thread-safety issue in calculating strategy labels.
Improve the thread-safety of strategy validation.
Improve the thread-safety of strategy validation.
Before this release, Hypothesis did not require that "super().init()" be called in "SearchStrategy" subclasses. Subclassing "SearchStrategy" is not supported or part of the public API, but if you are subclassing it anyway, you will need to make sure to call "super().init()" after this release.
The canonical version of these notes (with links) is on readthedocs.
Fix a remaining thread-safety issue with the deprecation warning for use of the global random instance (see v6.135.24).
Fix a remaining thread-safety issue with the deprecation warning for use of the global random instance (see v6.135.24).
The canonical version of these notes (with links) is on readthedocs.
Fix a remaining thread-safety issue with the deprecation warning for use of the global random instance (see v6.135.24).
Fix a remaining thread-safety issue with the recursion limit warning Hypothesis issues when an outside caller sets "sys.setrecursionlimit" (see 6.135.
Fix a remaining thread-safety issue with the recursion limit warning Hypothesis issues when an outside caller sets "sys.setrecursionlimit" (see 6.135.23 - 2025-07-02).
The canonical version of these notes (with links) is on readthedocs.
Fix a remaining thread-safety issue with the recursion limit warning Hypothesis issues when an outside caller sets sys.setrecursionlimit (see v6.135.23).
Optimize performance of "sampled_from()" and internal selection of stateful testing rules.
Optimize performance of "sampled_from()" and internal selection of stateful testing rules.
The canonical version of these notes (with links) is on readthedocs.
Optimize performance of |st.sampled_from| and internal selection of stateful testing rules.
Optimize the memory and speed of an internal datastructure for compactly storing integers.
Optimize the memory and speed of an internal datastructure for compactly storing integers.
The canonical version of these notes (with links) is on readthedocs.
Optimize the memory and speed of an internal datastructure for compactly storing integers.
Improve thread-safety for stateful "@initialize" rules.
Improve thread-safety for stateful "@initialize" rules.
The canonical version of these notes (with links) is on readthedocs.
Fix a "dictionary changed size during iteration" error that could occur under with "register_random()" under multiple threads.
Fix a "dictionary changed size during iteration" error that could occur under with "register_random()" under multiple threads.
The canonical version of these notes (with links) is on readthedocs.
Fix a "dictionary changed size during iteration" error that could occur under with |register_random| under multiple threads.
Improve thread safety of our "sys.monitoring" usage (by the "Phase.shrink" and "Phase.explain" phases), as well as the internal computation of strateg
Improve thread safety of our "sys.monitoring" usage (by the "Phase.shrink" and "Phase.explain" phases), as well as the internal computation of strategy labels.
The canonical version of these notes (with links) is on readthedocs.
Improve thread safety of our sys.monitoring usage (by the |Phase.shrink| and |Phase.explain| phases), as well as the internal computation of strategy labels.
Your coding agent can read these notes before it upgrades. Set up the MCP server →