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 10 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.
Improve "ExampleDatabase" documentation.
Improve "ExampleDatabase" documentation.
The canonical version of these notes (with links) is on readthedocs.
*The canonical version of these notes (with links) is on readthedocs.*
Add some internal type hints.
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 →
Improve "@settings" documentation.
Improve "@settings" documentation.
The canonical version of these notes (with links) is on readthedocs.
This patch adds "GITLAB_CI" to the environment variables checked when enabling the default CI settings profile.
This patch adds "GITLAB_CI" to the environment variables checked when enabling the default CI settings profile.
Thanks to Genevieve Mendoza for this contribution!
The canonical version of these notes (with links) is on readthedocs.
This patch adds GITLAB_CI to the environment variables checked when enabling the default CI |settings| profile.
Thanks to Genevieve Mendoza for this contribution!
Include "note()" and "Phase.explain" output in the "representation" field of observability reports for failing examples, to more closely match the out
Include "note()" and "Phase.explain" output in the "representation" field of observability reports for failing examples, to more closely match the output produced by Hypothesis.
The canonical version of these notes (with links) is on readthedocs.
Include |note| and |Phase.explain| output in the "representation" field of observability reports for failing examples, to more closely match the output produced by Hypothesis.
"BackgroundWriteDatabase" instances now defer creating and starting a thread until first use.
"BackgroundWriteDatabase" instances now defer creating and starting a thread until first use.
The canonical version of these notes (with links) is on readthedocs.
|BackgroundWriteDatabase| instances now defer creating and starting a thread until first use.
Improve the string representation of "characters()" in some cases.
Improve the string representation of "characters()" in some cases.
The canonical version of these notes (with links) is on readthedocs.
Cap the length of bytestrings collected as part of the constants- collection feature introduced in version 6.131.1, as long bytestrings are unlikely t
Cap the length of bytestrings collected as part of the constants- collection feature introduced in version 6.131.1, as long bytestrings are unlikely to be useful.
The canonical version of these notes (with links) is on readthedocs.
Cap the length of bytestrings collected as part of the constants-collection feature introduced in version 6.131.1, as long bytestrings are unlikely to be useful.
All "ExampleDatabase" implementations in Hypothesis now implement "__eq__".
All "ExampleDatabase" implementations in Hypothesis now implement "eq".
The canonical version of these notes (with links) is on readthedocs.
All |ExampleDatabase| implementations in Hypothesis now implement __eq__.
Further improve the performance of the new features introduced in version 6.131.1, by improving unions of large sets.
Further improve the performance of the new features introduced in version 6.131.1, by improving unions of large sets.
The canonical version of these notes (with links) is on readthedocs.
Further improve the performance of the new features introduced in version 6.131.1, by improving unions of large sets.
Improve performance of an internal method to count possible choices.
Improve performance of an internal method to count possible choices.
The canonical version of these notes (with links) is on readthedocs.
Improves output when assigning values to multiple target bundles in a stateful rule (issue #4361).
Improves output when assigning values to multiple target bundles in a stateful rule (issue #4361).
The canonical version of these notes (with links) is on readthedocs.
Improves output when assigning values to multiple target bundles in a stateful rule (4361).
Internal optimization to reduce redundant choice sequence spans.
Internal optimization to reduce redundant choice sequence spans.
The canonical version of these notes (with links) is on readthedocs.
Add a "for_failure: bool = False" parameter to "provider.realize" in alternative backends, so that symbolic-based backends can increase their timeouts
Add a "for_failure: bool = False" parameter to "provider.realize" in alternative backends, so that symbolic-based backends can increase their timeouts when realizing failures, which are more important than regular examples.
The canonical version of these notes (with links) is on readthedocs.
Improve type hints for the single-argument form of "one_of()". "st.one_of(strategies)" now matches the type of "st.one_of(*strategies)". For instance,
Improve type hints for the single-argument form of "one_of()". "st.one_of(strategies)" now matches the type of "st.one_of(*strategies)". For instance, "st.one_of([st.integers(), st.none()])" now has the correct type of "SearchStrategy[int | None]" instead of "SearchStrategy[Any]".
The canonical version of these notes (with links) is on readthedocs.
Fix incorrectly reporting alternative backends as unsound in some cases.
Fix incorrectly reporting alternative backends as unsound in some cases.
The canonical version of these notes (with links) is on readthedocs.
Fix incorrectly reporting alternative backends as unsound in some cases.
Remove more false-positive locations from "Phase.explain" output, and add a new "metadata.reproduction_decorator" field in observability reports for f
Remove more false-positive locations from "Phase.explain" output, and add a new "metadata.reproduction_decorator" field in observability reports for failing examples.
The canonical version of these notes (with links) is on readthedocs.
Remove more false-positive locations from |Phase.explain| output, and add a new metadata.reproduction_decorator field in observability reports for failing examples.
Fix a "BytesWarning" after version 6.131.1 if the source code used the same value in both a normal and binary string.
Fix a "BytesWarning" after version 6.131.1 if the source code used the same value in both a normal and binary string.
The canonical version of these notes (with links) is on readthedocs.
Fix a BytesWarning after version 6.131.1 if the source code used the same value in both a normal and binary string.
"DirectoryBasedExampleDatabase" will now fall back to (potentially non-atomic) copies rather than renames, if the temporary directory used for atomic
"DirectoryBasedExampleDatabase" will now fall back to (potentially non-atomic) copies rather than renames, if the temporary directory used for atomic write-and-rename is on a different filesystem to the configured database location (issue #4335).
The canonical version of these notes (with links) is on readthedocs.
Further improve the performance of the new features introduced in version 6.131.1.
Further improve the performance of the new features introduced in version 6.131.1.
The canonical version of these notes (with links) is on readthedocs.
Further improve the performance of the new features introduced in version 6.131.1.
This patch makes the new features introduced in version 6.131.1 much faster, and fixes an internal "RecursionError" when working with deeply-nested co
This patch makes the new features introduced in version 6.131.1 much faster, and fixes an internal "RecursionError" when working with deeply-nested code.
The canonical version of these notes (with links) is on readthedocs.
This patch makes the new features introduced in version 6.131.1 much faster, and fixes an internal RecursionError when working with deeply-nested code.
Fix a rare case where database entries were kept after they were no longer needed when using "Phase.target".
Fix a rare case where database entries were kept after they were no longer needed when using "Phase.target".
The canonical version of these notes (with links) is on readthedocs.
Fix a rare case where database entries were kept after they were no longer needed when using |Phase.target|.
Internal refactoring of the "@settings" object, with no user-visible change.
Internal refactoring of the "@settings" object, with no user-visible change.
The canonical version of these notes (with links) is on readthedocs.
Internal refactoring of the |@settings| object, with no user-visible change.
Fixes a rare internal error where new code from version 6.131.1 could fail if "sys.modules" is simultaneously modified, e.g. as a side effect of impor
Fixes a rare internal error where new code from version 6.131.1 could fail if "sys.modules" is simultaneously modified, e.g. as a side effect of imports executed from another thread. Our Thread-Safety Policy does not promise that this is supported, but we're happy to take reasonable fixes.
Thanks to Tony Li for reporting and fixing this issue.
The canonical version of these notes (with links) is on readthedocs.
The pub-sub change listening interface of the Hypothesis database now correctly fires events for "DirectoryBasedExampleDatabase" if the directory was
The pub-sub change listening interface of the Hypothesis database now correctly fires events for "DirectoryBasedExampleDatabase" if the directory was created after the listener was added.
Also disables on emscripten the constants-extraction feature introduced in 6.131.1 - 2025-04-17, where it caused substantial slowdown.
The canonical version of these notes (with links) is on readthedocs.
The pub-sub change listening interface of the Hypothesis database now correctly fires events for |DirectoryBasedExampleDatabase| if the directory was created after the listener was added.
Also disables on emscripten the constants-extraction feature introduced in v6.131.1, where it caused substantial slowdown.
Hypothesis now looks for constant values in the source code of your program, and sometimes uses them while generating examples. This lets Hypothesis g
Hypothesis now looks for constant values in the source code of your program, and sometimes uses them while generating examples. This lets Hypothesis generate interesting inputs that are specific to your program.
The canonical version of these notes (with links) is on readthedocs.
Add "is_hypothesis_test()", for third-party libraries which want to determine whether a test has been defined with Hypothesis.
Add "is_hypothesis_test()", for third-party libraries which want to determine whether a test has been defined with Hypothesis.
The canonical version of these notes (with links) is on readthedocs.
Add |is_hypothesis_test|, for third-party libraries which want to determine whether a test has been defined with Hypothesis.
*The canonical version of these notes (with links) is on readthedocs.*
Refactor some internals.
The canonical version of these notes (with links) is on readthedocs.
Lays some groundwork for future work on collecting interesting literals from the code being tested, for increased bug-finding power (issue #3127). The
Lays some groundwork for future work on collecting interesting literals from the code being tested, for increased bug-finding power (issue #3127). There is no user-visible change (yet!)
The canonical version of these notes (with links) is on readthedocs.
Lays some groundwork for future work on collecting interesting literals from the code being tested, for increased bug-finding power (3127). There is no user-visible change (yet!)
Fix the caching behavior of |st.sampled_from|, which in rare cases led to failing an internal assertion (4339).
Fix the caching behavior of |st.sampled_from|, which in rare cases led to failing an internal assertion (4339).
Fix the caching behavior of sampled_from() , which in rare cases led to failing an internal assertion ( issue #4339 ).
This patch deprecates creating a database using the abstract ExampleDatabase() class. Use one of the following instead:
This patch deprecates creating a database using the abstract ExampleDatabase() class. Use one of the following instead:
Replace ExampleDatabase(":memory:") with |InMemoryExampleDatabase|.
Replace ExampleDatabase("/path/to/dir") with |DirectoryBasedExampleDatabase|.
Replace ExampleDatabase() with either |InMemoryExampleDatabase| or |DirectoryBasedExampleDatabase|, depending on your needs. Previously, Hypothesis interpreted ExampleDatabase() as a |DirectoryBasedExampleDatabase| in the default .hypothesis directory, with a fallback to |InMemoryExampleDatabase| if that location was not available.
When reporting the always-failing, never-passing lines from the |Phase.explain| phase, we now sort the reported lines so that local code shows up firs
When reporting the always-failing, never-passing lines from the |Phase.explain| phase, we now sort the reported lines so that local code shows up first, then third-party library code, then standard library code.
Improves the documentation of "verbosity" objects.
Improves the documentation of "verbosity" objects.
The canonical version of these notes (with links) is on readthedocs.
Rename internal variables for clarity.
Rename internal variables for clarity.
The canonical version of these notes (with links) is on readthedocs.
Update the documentation link in "HealthCheck" error messages to their new location in the documentation.
Update the documentation link in "HealthCheck" error messages to their new location in the documentation.
The canonical version of these notes (with links) is on readthedocs.
Update the documentation link in |HealthCheck| error messages to their new location in the documentation.
Improve our internal type hints.
Improve our internal type hints.
The canonical version of these notes (with links) is on readthedocs.
Improve an additional interaction between the hypothesis-crosshair backend and our observability tools.
Improve an additional interaction between the hypothesis-crosshair backend and our observability tools.
The canonical version of these notes (with links) is on readthedocs.
Improve an additional interaction between the hypothesis-crosshair backend and our observability tools.
This patch improves the interaction between the hypothesis-crosshair backend and our observability tools.
This patch improves the interaction between the hypothesis-crosshair backend and our observability tools.
The canonical version of these notes (with links) is on readthedocs.
This patch improves the interaction between the hypothesis-crosshair backend and our observability tools.
Fix an issue with realizing symbolic values provided by alternative backends when Hypothesis encounters an internal error in its engine.
Fix an issue with realizing symbolic values provided by alternative backends when Hypothesis encounters an internal error in its engine.
The canonical version of these notes (with links) is on readthedocs.
Fix an issue with realizing symbolic values provided by alternative backends when Hypothesis encounters an internal error in its engine.
Improve the documentation for some strategies, including "@composite" and "data()".
Improve the documentation for some strategies, including "@composite" and "data()".
The canonical version of these notes (with links) is on readthedocs.
Improve the documentation for some strategies, including |st.composite| and |st.data|.
Nesting "@given" inside of "@given" is now a health check failure. Nesting "@given" results in quadratic generation and shrinking behavior, and can us
Nesting "@given" inside of "@given" is now a health check failure. Nesting "@given" results in quadratic generation and shrinking behavior, and can usually be more cleanly expressed by replacing the inner function with a "data()" parameter on the outer given. For more details, see "nested_given". (issue #4167)
The canonical version of these notes (with links) is on readthedocs.
Nesting @given inside of @given is now a |HealthCheck| failure. Nesting @given results in quadratic generation and shrinking behavior, and can usually be more cleanly expressed by replacing the inner function with a ~hypothesis.strategies.data parameter on the outer given. For more details, see ~hypothesis.HealthCheck.nested_given. (4167)
Fixes an internal error when certain alternative backends find a failure on their very first generated example.
Fixes an internal error when certain alternative backends find a failure on their very first generated example.
The canonical version of these notes (with links) is on readthedocs.
Fixes an internal error when certain alternative backends find a failure on their very first generated example.
"nothing()" is now typed as "SearchStrategy[Never]", because no value can ever be drawn from it. This may help type checkers statically determine that
"nothing()" is now typed as "SearchStrategy[Never]", because no value can ever be drawn from it. This may help type checkers statically determine that some code is not reachable.
The canonical version of these notes (with links) is on readthedocs.
~hypothesis.strategies.nothing is now typed as SearchStrategy[Never], because no value can ever be drawn from it. This may help type checkers statically determine that some code is not reachable.
This patch improves the string representation of "fixed_dictionaries()".
This patch improves the string representation of "fixed_dictionaries()".
The canonical version of these notes (with links) is on readthedocs.
This patch improves the string representation of ~hypothesis.strategies.fixed_dictionaries.
Improve how the shrinker checks for unnecessary work, leading to 10% less time spent shrinking on average, with no reduction in quality.
Improve how the shrinker checks for unnecessary work, leading to 10% less time spent shrinking on average, with no reduction in quality.
The canonical version of these notes (with links) is on readthedocs.
Improve how the shrinker checks for unnecessary work, leading to 10% less time spent shrinking on average, with no reduction in quality.
"randoms()" no longer produces "1.0", matching the exclusive upper bound of "random.Random.random" (issue #4297).
"randoms()" no longer produces "1.0", matching the exclusive upper bound of "random.Random.random" (issue #4297).
The canonical version of these notes (with links) is on readthedocs.
~hypothesis.strategies.randoms no longer produces 1.0, matching the exclusive upper bound of random.Random.random (4297).
This release adds a ""hypothesis-urandom"" backend, which draws randomness from "/dev/urandom" instead of Python's PRNG. This is useful for users of A
This release adds a ""hypothesis-urandom"" backend, which draws randomness from "/dev/urandom" instead of Python's PRNG. This is useful for users of Antithesis who also have Hypothesis tests, allowing Antithesis mutation of "/dev/urandom" to drive Hypothesis generation. We expect it to be strictly slower than the default backend for everyone else.
It can be enabled with "@settings(backend="hypothesis-urandom")".
The canonical version of these notes (with links) is on readthedocs.
For strategies which draw make recursive draws, including "recursive()" and "deferred()", we now generate examples with duplicated subtrees more often
For strategies which draw make recursive draws, including "recursive()" and "deferred()", we now generate examples with duplicated subtrees more often. This tends to uncover interesting behavior in tests.
For instance, we might now generate a tree like this more often (though the details depend on the strategy):
┌─────┐
┌──────┤ a ├──────┐
│ └─────┘ │
┌──┴──┐ ┌──┴──┐
│ b │ │ a │
└──┬──┘ └──┬──┘
┌────┴────┐ ┌────┴────┐
┌──┴──┐ ┌──┴──┐ ┌──┴──┐ ┌──┴──┐ │ c │ │ d │ │ b │ │ ... │ └─────┘ └─────┘ └──┬──┘ └─────┘ ┌────┴────┐ ┌──┴──┐ ┌──┴──┐ │ c │ │ d │ └─────┘ └─────┘
The canonical version of these notes (with links) is on readthedocs.
For strategies which draw make recursive draws, including ~hypothesis.strategies.recursive and ~hypothesis.strategies.deferred, we now generate examples with duplicated subtrees more often. This tends to uncover interesting behavior in tests.
For instance, we might now generate a tree like this more often (though the details depend on the strategy):
┌─────┐
┌──────┤ a ├──────┐
│ └─────┘ │
┌──┴──┐ ┌──┴──┐
│ b │ │ a │
└──┬──┘ └──┬──┘
┌────┴────┐ ┌────┴────┐
┌──┴──┐ ┌──┴──┐ ┌──┴──┐ ┌──┴──┐
│ c │ │ d │ │ b │ │ ... │
└─────┘ └─────┘ └──┬──┘ └─────┘
┌────┴────┐
┌──┴──┐ ┌──┴──┐
│ c │ │ d │
└─────┘ └─────┘
Improves input validation for several strategies in our pandas extra, so that they raise a helpful "InvalidArgument" rather than "OverflowError".
Improves input validation for several strategies in our pandas extra, so that they raise a helpful "InvalidArgument" rather than "OverflowError".
Discovered by our recent string generation upgrade.
The canonical version of these notes (with links) is on readthedocs.
Improves input validation for several strategies in our pandas extra, so that they raise a helpful InvalidArgument rather than OverflowError.
Discovered by our recent string generation upgrade.
Rename a few internal classes for clarity.
Rename a few internal classes for clarity.
The canonical version of these notes (with links) is on readthedocs.
"text()" now occasionally generates from a preselected list of strings which are likely to find bugs. These include ligatures, right-to-left and top-t
"text()" now occasionally generates from a preselected list of strings which are likely to find bugs. These include ligatures, right-to-left and top-to-bottom text, emojis, emoji modifiers, strings like ""Infinity"", ""None"", and ""FALSE"", and other interesting things. This is especially useful when testing the full unicode range, where the search space is too large for uniform sampling to be very effective.
Of course, examples generated this way shrink just like they normally would. It was always possible for Hypothesis to generate these strings; it is just more likely after this change. From the outside, it is as if Hypothesis generated the example completely randomly.
Many thanks to the Big List of Naughty Strings, Text Rendering Hates You, and Text Editing Hates You Too for forming the basis of this list.
The canonical version of these notes (with links) is on readthedocs.
We now provide a better string representation for "one_of()" strategies, by flattening consecutive "|" combinations. For instance:
We now provide a better string representation for "one_of()" strategies, by flattening consecutive "|" combinations. For instance:
st.integers() | st.text() | st.booleans()
one_of(integers(), text(), booleans())
Explicit calls to "one_of()" remain unflattened, in order to make tracking down complicated "one_of()" constructions easier:
st.one_of(st.integers(), st.one_of(st.text(), st.booleans())) one_of(integers(), one_of(text(), booleans()))
We print "one_of" in reprs (rather than "integers() | text() | ...") for consistency with reprs containing ".filter" or ".map" calls, which uses the full "one_of" to avoid ambiguity.
The canonical version of these notes (with links) is on readthedocs.
We now provide a better string representation for ~hypothesis.strategies.one_of strategies, by flattening consecutive | combinations. For instance:
>>> st.integers() | st.text() | st.booleans()
# previously: one_of(one_of(integers(), text()), booleans())
one_of(integers(), text(), booleans())
Explicit calls to ~hypothesis.strategies.one_of remain unflattened, in order to make tracking down complicated ~hypothesis.strategies.one_of constructions easier:
>>> st.one_of(st.integers(), st.one_of(st.text(), st.booleans()))
one_of(integers(), one_of(text(), booleans()))
We print one_of in reprs (rather than integers() | text() | ...) for consistency with reprs containing .filter or .map calls, which uses the full one_of to avoid ambiguity.
This patch improves shrinking behavior for values from "text()" and "binary()" which contain duplicate elements, like ""zzzabc"". It also improves shr
This patch improves shrinking behavior for values from "text()" and "binary()" which contain duplicate elements, like ""zzzabc"". It also improves shrinking for bugs which require the same character to be drawn from two different "text()" strategies to trigger.
The canonical version of these notes (with links) is on readthedocs.
This patch improves shrinking behavior for values from ~hypothesis.strategies.text and ~hypothesis.strategies.binary which contain duplicate elements, like "zzzabc". It also improves shrinking for bugs which require the same character to be drawn from two different ~hypothesis.strategies.text strategies to trigger.
Fix a type-hinting regression from version 6.125.1, where we would no longer guarantee the type of the argument to ".filter" predicates (issue #4269).
Fix a type-hinting regression from version 6.125.1, where we would no longer guarantee the type of the argument to ".filter" predicates (issue #4269).
st.integers().filter(lambda x: x > 0)
The canonical version of these notes (with links) is on readthedocs.
Fix a type-hinting regression from version 6.125.1, where we would no longer guarantee the type of the argument to .filter predicates (4269).
# x was previously Unknown, but is now correctly guaranteed to be int
st.integers().filter(lambda x: x > 0)
This patch tweaks the performance of the target phase, avoiding aborting some test cases when it would be better to finish generating them.
This patch tweaks the performance of the target phase, avoiding aborting some test cases when it would be better to finish generating them.
The canonical version of these notes (with links) is on readthedocs.
This patch tweaks the performance of |Phase.target|, avoiding aborting some test cases when it would be better to finish generating them.
This patch fixes a bug where "from_type()" would error on certain types involving "Protocol" (issue #4194).
This patch fixes a bug where "from_type()" would error on certain types involving "Protocol" (issue #4194).
The canonical version of these notes (with links) is on readthedocs.
This patch fixes a bug where ~hypothesis.strategies.from_type would error on certain types involving ~python:typing.Protocol (4194).
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.
Improve shrinking of non-standard NaN float values (issue #4277).
Improve shrinking of non-standard NaN float values (issue #4277).
The canonical version of these notes (with links) is on readthedocs.
Adjust type hints for the pub-sub database implementation in version 6.126.0, and remove a remnant debug print in its implementation.
Adjust type hints for the pub-sub database implementation in version 6.126.0, and remove a remnant debug print in its implementation.
The canonical version of these notes (with links) is on readthedocs.
Adjust type hints for the pub-sub database implementation in version 6.126.0, and remove a remnant debug print in its implementation.
Improve the clarity of printing counterexamples in stateful testing, by avoiding confusing "Bundle" references with equivalent values drawn from a reg
Improve the clarity of printing counterexamples in stateful testing, by avoiding confusing "Bundle" references with equivalent values drawn from a regular strategy.
For example, we now print:
instead of
if the "unrelated" rule draws from a regular strategy such as "integers()" instead of the "a" bundle.
The canonical version of these notes (with links) is on readthedocs.
Improve the clarity of printing counterexamples in stateful testing, by avoiding confusing ~hypothesis.stateful.Bundle references with equivalent values drawn from a regular strategy.
For example, we now print:
a_0 = state.add_to_bundle(a=0)
state.unrelated(value=0)
instead of
a_0 = state.add_to_bundle(a=0)
state.unrelated(value=a_0)
if the unrelated rule draws from a regular strategy such as ~hypothesis.strategies.integers instead of the a bundle.
Improve the clarity of printing counterexamples in stateful testing , by avoiding confusing Bundle references with equivalent values drawn from a regular strategy.
For example, we now print:
a_0 = state . add_to_bundle ( a = 0 ) state . unrelated ( value = 0 )
instead of
a_0 = state . add_to_bundle ( a = 0 ) state . unrelated ( value = a_0 )
if the unrelated rule draws from a regular strategy such as integers() instead of the a bundle.
One column per quarter.