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.17
Last release today
20 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
1596 releases · first in 2013
Drag across the ruler to compare, or tap a release to open it.
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
Your coding agent can read these notes before it upgrades. Set up the MCP server →
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.
Makes the deprecation warning for using the global random instance thread-safe, as part of our work towards thread safety (issue #4451).
Makes the deprecation warning for using the global random instance thread-safe, as part of our work towards thread safety (issue #4451).
The canonical version of these notes (with links) is on readthedocs.
Makes the deprecation warning for using the global random instance thread-safe, as part of our work towards thread safety (4451).
In order to de-flake "RecursionError" failures, Hypothesis sets a deterministic limit on "sys.setrecursionlimit". This patch makes the setting of this
In order to de-flake "RecursionError" failures, Hypothesis sets a deterministic limit on "sys.setrecursionlimit". This patch makes the setting of this limit aware of uses by Hypothesis from multiple threads, so it does not produce spurious warnings in multithreaded environments.
The canonical version of these notes (with links) is on readthedocs.
Improves the thread safety of caching strategy definitions, as well as usage of strategy transformations like ".map()" and ".filter()".
Improves the thread safety of caching strategy definitions, as well as usage of strategy transformations like ".map()" and ".filter()".
The canonical version of these notes (with links) is on readthedocs.
Improves the thread safety of caching strategy definitions, as well as usage of strategy transformations like |.map| and |.filter|.
Fix the thread safety of "@rule" definitions in "RuleBasedStateMachine".
Fix the thread safety of "@rule" definitions in "RuleBasedStateMachine".
The canonical version of these notes (with links) is on readthedocs.
Fix the thread safety of |@rule| definitions in |RuleBasedStateMachine|.
Fixes "reproduction_decorator" being missing under hypothesis-specific metadata in many observability observations, when it should have been present.
Fixes "reproduction_decorator" being missing under hypothesis-specific metadata in many observability observations, when it should have been present.
The canonical version of these notes (with links) is on readthedocs.
Fixes reproduction_decorator being missing under hypothesis-specific metadata in many observability observations, when it should have been present.
Improve threading compatibility of an internal helper for managing deterministic rng seeding.
Improve threading compatibility of an internal helper for managing deterministic rng seeding.
The canonical version of these notes (with links) is on readthedocs.
Improve threading compatibility of an internal helper for managing deterministic rng seeding.
Remove an internal assertion which could trigger if (1) a lambda was present in the source code of a test, (2) and the source code file was edited on
Remove an internal assertion which could trigger if (1) a lambda was present in the source code of a test, (2) and the source code file was edited on disk between the start of the python process and when Hypothesis runs the property.
The canonical version of these notes (with links) is on readthedocs.
Refactor some internals related to the shrinker for better compatibility with free-threading (issue #4451).
Refactor some internals related to the shrinker for better compatibility with free-threading (issue #4451).
The canonical version of these notes (with links) is on readthedocs.
Refactor some internals related to the shrinker for better compatibility with free-threading (4451).
Fixes an error when the "_pytest" module is present in "sys.modules", but *not* the "_pytest.outcomes" or "_pytest.fixtures" modules. This can happen
Fixes an error when the "_pytest" module is present in "sys.modules", but not the "_pytest.outcomes" or "_pytest.fixtures" modules. This can happen with code that imports just "_pytest", without importing "pytest".
The canonical version of these notes (with links) is on readthedocs.
Temporarily disable the warning when "shared()" strategies with the same "key" draw from different base strategies, due to false alarms. Once we fix t
Temporarily disable the warning when "shared()" strategies with the same "key" draw from different base strategies, due to false alarms. Once we fix the false alarms in a future release, the warning will be re-enabled.
The canonical version of these notes (with links) is on readthedocs.
Temporarily disable the warning when |st.shared| strategies with the same key draw from different base strategies, due to false alarms. Once we fix the false alarms in a future release, the warning will be re-enabled.
Speed up usages of "sampled_from()" by deferring evaluation of its repr, and truncating its repr for large collections (over 512 elements). This is es
Speed up usages of "sampled_from()" by deferring evaluation of its repr, and truncating its repr for large collections (over 512 elements). This is especially noticeable when using "sampled_from()" with large collections. The repr of "sampled_from()" strategies involving sequence classes with custom reprs may change as a result of this release.
The canonical version of these notes (with links) is on readthedocs.
Speed up usages of |st.sampled_from| by deferring evaluation of its repr, and truncating its repr for large collections (over 512 elements). This is especially noticeable when using |st.sampled_from| with large collections. The repr of |st.sampled_from| strategies involving sequence classes with custom reprs may change as a result of this release.
Fixes a substantial performance regression in stateful tests from computing string representations, present since version 6.131.20.
Fixes a substantial performance regression in stateful tests from computing string representations, present since version 6.131.20.
The canonical version of these notes (with links) is on readthedocs.
Fixes a substantial performance regression in stateful tests from computing string representations, present since version 6.131.20.
Fix a rare race condition in internal cache eviction logic.
Fix a rare race condition in internal cache eviction logic.
The canonical version of these notes (with links) is on readthedocs.
This patch fixes an error when importing our django extra (via "hypothesis.extra.django") if "django.contrib.auth" was not in "INSTALLED_APPS" (issue
This patch fixes an error when importing our django extra (via "hypothesis.extra.django") if "django.contrib.auth" was not in "INSTALLED_APPS" (issue #3716).
Thanks to Chris Wesseling for this fix!
The canonical version of these notes (with links) is on readthedocs.
Fix a rare race condition in "fetch()", where we might have read from a non-existent directory.
Fix a rare race condition in "fetch()", where we might have read from a non-existent directory.
The canonical version of these notes (with links) is on readthedocs.
Fix a rare race condition in |ExampleDatabase.fetch|, where we might have read from a non-existent directory.
Refactor some internal code related to patches to make it easier to test.
Refactor some internal code related to patches to make it easier to test.
The canonical version of these notes (with links) is on readthedocs.
Refactor some internal code related to patches to make it easier to test.
Add type hints to internal code for patching.
Add type hints to internal code for patching.
The canonical version of these notes (with links) is on readthedocs.
Fixes a race condition in "add_listener()" for "DirectoryBasedExampleDatabase" after version 6.135.1 where the listener might have tried to read a fil
Fixes a race condition in "add_listener()" for "DirectoryBasedExampleDatabase" after version 6.135.1 where the listener might have tried to read a file that doesn't exist.
The canonical version of these notes (with links) is on readthedocs.
Fixes a race condition in |ExampleDatabase.add_listener| for |DirectoryBasedExampleDatabase| after version 6.135.1 where the listener might have tried to read a file that doesn't exist.
This patch corrects the f-string formatting of a few array-related error messages.
This patch corrects the f-string formatting of a few array-related error messages.
The canonical version of these notes (with links) is on readthedocs.
This patch corrects the f-string formatting of a few array-related error messages.
Improve the error message when applying "@given" to a pytest fixture with pytest 8.4.0.
Improve the error message when applying "@given" to a pytest fixture with pytest 8.4.0.
The canonical version of these notes (with links) is on readthedocs.
Improve the error message when applying |@given| to a pytest fixture with pytest 8.4.0.
Further improve the performance of the constants-collection feature introduced in version 6.131.1, by ignoring large files and files with many constan
Further improve the performance of the constants-collection feature introduced in version 6.131.1, by ignoring large files and files with many constants.
The canonical version of these notes (with links) is on readthedocs.
Further improve the performance of the constants-collection feature introduced in version 6.131.1, by ignoring large files and files with many constants.
This release adds the experimental and unstable "OBSERVABILITY_CHOICES" option for observability. If set, the choice sequence is included in "metadata
This release adds the experimental and unstable "OBSERVABILITY_CHOICES" option for observability. If set, the choice sequence is included in "metadata.choice_nodes", and choice sequence spans are included in "metadata.choice_spans".
These are relatively low-level implementation detail of Hypothesis, and are exposed in observability for users building tools or research on top of Hypothesis. See "PrimitiveProvider" for more details about the choice sequence and choice spans.
We are actively working towards a better interface for this. Feel free to use "OBSERVABILITY_CHOICES" to experiment, but don't rely on it yet!
The canonical version of these notes (with links) is on readthedocs.
This patch restores compatibility when using the legacy Python 3.9 LL(1) parser yet again, because the fix in version 6.131.33 was too brittle.
This patch restores compatibility when using the legacy Python 3.9 LL(1) parser yet again, because the fix in version 6.131.33 was too brittle.
Thanks to Marco Ricci for this fix!
The canonical version of these notes (with links) is on readthedocs.
"DirectoryBasedExampleDatabase" now removes empty directories after "delete()" is called.
"DirectoryBasedExampleDatabase" now removes empty directories after "delete()" is called.
The canonical version of these notes (with links) is on readthedocs.
|DirectoryBasedExampleDatabase| now removes empty directories after |ExampleDatabase.delete| is called.
This release adds "run_conformance_test()", for use in testing implementations of alternative backends.
This release adds "run_conformance_test()", for use in testing implementations of alternative backends.
The canonical version of these notes (with links) is on readthedocs.
This release adds ~hypothesis.internal.conjecture.provider_conformance.run_conformance_test, for use in testing implementations of alternative backends.
This patch adds "hypothesis.extra.django.SimpleTestCase" (issue #4117)
This patch adds "hypothesis.extra.django.SimpleTestCase" (issue #4117)
Thanks to Chris Wesseling for this contribution!
The canonical version of these notes (with links) is on readthedocs.
This patch adds hypothesis.extra.django.SimpleTestCase (4117)
Thanks to Chris Wesseling for this contribution!
Internal changes to support hypofuzz.
Internal changes to support hypofuzz.
The canonical version of these notes (with links) is on readthedocs.
The "to_json" hook used internally when writing observability reports is now supported on nested dataclasses (in addition to outermost dataclasses).
The "to_json" hook used internally when writing observability reports is now supported on nested dataclasses (in addition to outermost dataclasses).
The canonical version of these notes (with links) is on readthedocs.
The to_json hook used internally when writing observability reports is now supported on nested dataclasses (in addition to outermost dataclasses).
Warn when "shared()" strategies with the same "key" draw from different base strategies. This could lead to subtle failures or lower-than-expected exa
Warn when "shared()" strategies with the same "key" draw from different base strategies. This could lead to subtle failures or lower-than-expected example coverage.
The canonical version of these notes (with links) is on readthedocs.
Warn when ~hypothesis.strategies.shared strategies with the same key draw from different base strategies. This could lead to subtle failures or lower-than-expected example coverage.
Add "on_observation()" to the internal alternative backends interface.
Add "on_observation()" to the internal alternative backends interface.
The canonical version of these notes (with links) is on readthedocs.
Add |PrimitiveProvider.on_observation| to the internal alternative backends interface.
This patch restores compatibility when using the legacy Python 3.9 LL(1) parser, which was accidentally broken since version 6.130.13.
This patch restores compatibility when using the legacy Python 3.9 LL(1) parser, which was accidentally broken since version 6.130.13.
Thanks to Marco Ricci for this fix!
The canonical version of these notes (with links) is on readthedocs.
fuzz_one_input now writes observability reports if observability is enabled, bringing it in line with the behavior of other standard ways to invoke a
fuzz_one_input now writes observability reports if observability is enabled, bringing it in line with the behavior of other standard ways to invoke a Hypothesis test.
The canonical version of these notes (with links) is on readthedocs.
fuzz_one_input now writes observability reports if observability is enabled, bringing it in line with the behavior of other standard ways to invoke a Hypothesis test.
Improve documentation of "@example".
Improve documentation of "@example".
The canonical version of these notes (with links) is on readthedocs.
This patch resolves a Pandas FutureWarning (issue #4400) caused by indexing with an integer key.
This patch resolves a Pandas FutureWarning (issue #4400) caused by indexing with an integer key.
The canonical version of these notes (with links) is on readthedocs.
This patch resolves a Pandas FutureWarning (4400) caused by indexing with an integer key.
The observations passed to "TESTCASE_CALLBACKS" are now dataclasses, rather than dictionaries. The content written to ".hypothesis/observed" under "HY
The observations passed to "TESTCASE_CALLBACKS" are now dataclasses, rather than dictionaries. The content written to ".hypothesis/observed" under "HYPOTHESIS_EXPERIMENTAL_OBSERVABILITY" remains the same.
The canonical version of these notes (with links) is on readthedocs.
The observations passed to |TESTCASE_CALLBACKS| are now dataclasses, rather than dictionaries. The content written to .hypothesis/observed under HYPOTHESIS_EXPERIMENTAL_OBSERVABILITY remains the same.
One column per quarter.