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 release adds a "min_leaves" argument to "recursive()", which ensures that generated recursive structures have at least the specified number of le
This release adds a "min_leaves" argument to "recursive()", which ensures that generated recursive structures have at least the specified number of leaf nodes (issue #4205).
The canonical version of these notes (with links) is on readthedocs.
This release adds a min_leaves argument to ~hypothesis.strategies.recursive, which ensures that generated recursive structures have at least the specified number of leaf nodes (4205).
Add type hints to an internal class.
Add type hints to an internal class.
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 →
This release extends the explain-phase "# or any other generated value" comments to sub-arguments within "builds()", "tuples()", and "fixed_dictionari
This release extends the explain-phase "# or any other generated value" comments to sub-arguments within "builds()", "tuples()", and "fixed_dictionaries()".
Previously, these comments only appeared on top-level test arguments. Now, when the explain phase determines that a sub-argument can vary freely without affecting the test failure, you'll see comments like:
Falsifying example: test_foo( obj=MyClass( x=0, # or any other generated value y=True, ), data=( '', # or any other generated value 42, ), )
This makes it easier to understand which parts of complex inputs actually matter for reproducing a failure.
The canonical version of these notes (with links) is on readthedocs.
This release extends the explain-phase # or any other generated value comments to sub-arguments within ~hypothesis.strategies.builds, ~hypothesis.strategies.tuples, and ~hypothesis.strategies.fixed_dictionaries.
Previously, these comments only appeared on top-level test arguments. Now, when the explain phase determines that a sub-argument can vary freely without affecting the test failure, you'll see comments like:
Falsifying example: test_foo(
obj=MyClass(
x=0, # or any other generated value
y=True,
),
data=(
'', # or any other generated value
42,
),
)
This makes it easier to understand which parts of complex inputs actually matter for reproducing a failure.
*The canonical version of these notes (with links) is on readthedocs.*
Clean up an internal helper.
The canonical version of these notes (with links) is on readthedocs.
This patch fixes "from_type()" to properly handle parameterized type aliases created with Python 3.12+'s PEP 695 "type" statement. For example, "st.fr
This patch fixes "from_type()" to properly handle parameterized type aliases created with Python 3.12+'s PEP 695 "type" statement. For example, "st.from_type(A[int])" where "type A[T] = list[T]" now correctly resolves to "lists(integers())" instead of raising a "TypeError" (issue #4628).
The canonical version of these notes (with links) is on readthedocs.
This patch fixes ~hypothesis.strategies.from_type to properly handle parameterized type aliases created with Python 3.12+'s 695 type statement. For example, st.from_type(A[int]) where type A[T] = list[T] now correctly resolves to lists(integers()) instead of raising a TypeError (4628).
Hypothesis now prints a "Verbosity.verbose" log when we switch away from an alternative backend.
Hypothesis now prints a "Verbosity.verbose" log when we switch away from an alternative backend.
The canonical version of these notes (with links) is on readthedocs.
Hypothesis now prints a |Verbosity.verbose| log when we switch away from an alternative backend.
Fixes Ghostwriter output for numpy >= 2.4.0. Also adds support "from_type()" for numpy 2.5.0 nightly (which has not yet been released).
Fixes Ghostwriter output for numpy >= 2.4.0. Also adds support "from_type()" for numpy 2.5.0 nightly (which has not yet been released).
The canonical version of these notes (with links) is on readthedocs.
Fixes Ghostwriter output for numpy >= 2.4.0. Also adds support |st.from_type| for numpy 2.5.0 nightly (which has not yet been released).
".example()" no longer emits "NonInteractiveExampleWarning" when running a python file directly. This means that e.g. "python my_sandbox.py" during ex
".example()" no longer emits "NonInteractiveExampleWarning" when running a python file directly. This means that e.g. "python my_sandbox.py" during exploratory work with ".example()" will no longer raise warnings.
The canonical version of these notes (with links) is on readthedocs.
Add "__dict__" and "__proto__" to the list of constant strings Hypothesis sometimes generates.
Add "dict" and "proto" to the list of constant strings Hypothesis sometimes generates.
The canonical version of these notes (with links) is on readthedocs.
Add __dict__ and __proto__ to the list of constant strings Hypothesis sometimes generates.
When multiple explicit "@example" decorators fail with the same error, Hypothesis now shows only the simplest failing example (by shortlex order) with
When multiple explicit "@example" decorators fail with the same error, Hypothesis now shows only the simplest failing example (by shortlex order) with a note about how many other examples also failed (issue #4520).
To see all failing examples, use "Verbosity.verbose" or higher.
The canonical version of these notes (with links) is on readthedocs.
Fix a bug where we persisted symbolics from solver-based alternative backends in "event()".
Fix a bug where we persisted symbolics from solver-based alternative backends in "event()".
The canonical version of these notes (with links) is on readthedocs.
Fix a bug where we persisted symbolics from solver-based alternative backends in |event|.
This patch improves the error message for "FlakyStrategyDefinition" when the precondition for a rule is flaky (issue #4206).
This patch improves the error message for "FlakyStrategyDefinition" when the precondition for a rule is flaky (issue #4206).
The canonical version of these notes (with links) is on readthedocs.
This patch improves the error message for ~hypothesis.errors.FlakyStrategyDefinition when the precondition for a rule is flaky (4206).
This patch improves the type annotations for "basic_indices()". The return type now accurately reflects the "allow_ellipsis" and "allow_newaxis" param
This patch improves the type annotations for "basic_indices()". The return type now accurately reflects the "allow_ellipsis" and "allow_newaxis" parameters, excluding "EllipsisType" or "None" from the union when those index types are disabled (issue #4607).
Additionally, "assume()" now has overloaded type annotations: "assume(True)" returns "Literal[True]", while "assume(False)" and "assume(None)" return "NoReturn".
The canonical version of these notes (with links) is on readthedocs.
This patch improves the type annotations for ~hypothesis.extra.numpy.basic_indices. The return type now accurately reflects the allow_ellipsis and allow_newaxis parameters, excluding EllipsisType or None from the union when those index types are disabled (4607).
Additionally, ~hypothesis.assume now has overloaded type annotations: assume(True) returns Literal[True], while assume(False) and assume(None) return NoReturn.
*The canonical version of these notes (with links) is on readthedocs.*
Clean up some internal code.
The canonical version of these notes (with links) is on readthedocs.
*The canonical version of these notes (with links) is on readthedocs.*
Document "fuzz_one_input()".
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.
Calling "register_profile()" from within a test decorated with "@settings" is now deprecated, to avoid confusion about which settings are used as the…
Calling "register_profile()" from within a test decorated with "@settings" is now deprecated, to avoid confusion about which settings are used as the baseline for the new profile.
The canonical version of these notes (with links) is on readthedocs.
Calling ~hypothesis.settings.register_profile from within a test decorated with @settings is now deprecated, to avoid confusion about which settings are used as the baseline for the new profile.
This release drops support for nose, which ceased development 9 years ago and does not support Python 3.10 or newer.
This release drops support for nose, which ceased development 9 years ago and does not support Python 3.10 or newer.
Hypothesis still supports nose2. While we do not test "nose2" in our CI, we will fix any bugs that get reported.
The canonical version of these notes (with links) is on readthedocs.
Instantiating "Verbosity", "Phase", or "HealthCheck" with an integer, such as "Verbosity(0)", is now deprecated.
"@settings" now accepts equivalent string representations for "settings.verbosity", "settings.phases", and "settings.suppress_health_check". For example:
settings(verbosity=Verbosity.verbose) settings(verbosity="verbose")
settings(phases=[Phase.explicit]) settings(phases=["explicit"])
settings(suppress_health_check=[HealthCheck.filter_too_much]) settings(suppress_health_check=["filter_too_much"])
This release also changes the canonical value of "Verbosity", "Phase", and "HealthCheck" members to a string instead of an integer. For example, "Phase.reuse.value == "explicit"" as of this release, where previously "Phase.reuse.value == 1".
Instantiating "Verbosity", "Phase", or "HealthCheck" with an integer, such as "Verbosity(0)", is now deprecated.
The canonical version of these notes (with links) is on readthedocs.
Refactor some internal logic around strategy definitions.
Refactor some internal logic around strategy definitions.
The canonical version of these notes (with links) is on readthedocs.
Hypothesis previously required attrs as a dependency. This release removes that dependency, so that the only required dependency of Hypothesis is sort
Hypothesis previously required attrs as a dependency. This release removes that dependency, so that the only required dependency of Hypothesis is sortedcontainers.
All attrs-specific features of Hypothesis, such as using "from_type()" with attrs classes, will continue to behave as before.
The canonical version of these notes (with links) is on readthedocs.
Hypothesis previously required attrs as a dependency. This release removes that dependency, so that the only required dependency of Hypothesis is sortedcontainers.
All attrs-specific features of Hypothesis, such as using |st.from_type| with attrs classes, will continue to behave as before.
Tweak how Hypothesis hides internal tracebacks to fix an error under rare conditions (issue #3822).
Tweak how Hypothesis hides internal tracebacks to fix an error under rare conditions (issue #3822).
The canonical version of these notes (with links) is on readthedocs.
Tweak how Hypothesis hides internal tracebacks to fix an error under rare conditions (3822).
Bounding "decimals()" with *other* values that cannot be exactly represented is now deprecated; previously the bounds could be off by one.
This release adds support for "Fraction" objects as "min_value" and "max_value" bounds in "decimals()", if they can be exactly represented as decimals in the target precision (issue #4466).
Bounding "decimals()" with other values that cannot be exactly represented is now deprecated; previously the bounds could be off by one.
The canonical version of these notes (with links) is on readthedocs.
This release adds support for ~fractions.Fraction objects as min_value and max_value bounds in ~hypothesis.strategies.decimals, if they can be exactly represented as decimals in the target precision (4466).
Bounding ~hypothesis.strategies.decimals with other values that cannot be exactly represented is now deprecated; previously the bounds could be off by one.
"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
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|.
One column per quarter.