NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #407 most downloaded on PyPI
The property-based testing library for Python
Last release 7 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
This patch is for downstream packagers - our tests now pass under pytest 3.7.0 (released 2018-07-30). There are no changes to the source of Hypothesis
This patch is for downstream packagers - our tests now pass under pytest 3.7.0 (released 2018-07-30). There are no changes to the source of Hypothesis itself.
This release removes some functionality from the shrinker that was taking a considerable amount of time and does not appear to be useful any more due
This release removes some functionality from the shrinker that was taking a considerable amount of time and does not appear to be useful any more due to a number of quality improvements in the shrinker.
You may see some degradation in shrink quality as a result of this, but mostly shrinking should just get much faster.
One column per quarter.
This release slightly changes the format of some debugging information emitted during shrinking, and refactors some of the internal interfaces around
This release slightly changes the format of some debugging information emitted during shrinking, and refactors some of the internal interfaces around that.
This release is a very small internal refactoring which should have no user visible impact.
This release is a very small internal refactoring which should have no user visible impact.
This release fixes a bug that could cause an IndexError to be raised from inside Hypothesis during shrinking. It is likely that it was impossible to t
This release fixes a bug that could cause an IndexError to be raised from inside Hypothesis during shrinking. It is likely that it was impossible to trigger this bug in practice - it was only made visible by some currently unreleased work.
This release is a very small internal refactoring which should have no user visible impact.
This release is a very small internal refactoring which should have no user visible impact.
This release makes Hypothesis's shrinking faster by removing some redundant work that it does when minimizing values in its internal representation.
This release makes Hypothesis's shrinking faster by removing some redundant work that it does when minimizing values in its internal representation.
This release expands the deprecation of timeout from 3.16.0 to also emit the deprecation warning in find or stateful testing .
This release expands the deprecation of timeout from 3.16.0 to also emit the deprecation warning in find or stateful testing.
This release adds an additional shrink pass that is able to reduce the size of examples in some cases where the transformation is non-obvious. In part
This release adds an additional shrink pass that is able to reduce the size of examples in some cases where the transformation is non-obvious. In particular this will improve the quality of some examples which would have regressed in 3.66.12.
This release changes how we group data together for shrinking. It should result in improved shrinker performance, especially in stateful testing.
This release changes how we group data together for shrinking. It should result in improved shrinker performance, especially in stateful testing.
This patch modifies how which rule to run is selected during rule based stateful testing . This should result in a slight performance increase during
This patch modifies how which rule to run is selected during rule based stateful testing. This should result in a slight performance increase during generation and a significant performance and quality improvement when shrinking.
As a result of this change, some state machines which would previously have thrown an InvalidDefinition are no longer detected as invalid.
This release weakens some minor functionality in the shrinker that had only modest benefit and made its behaviour much harder to reason about.
This release weakens some minor functionality in the shrinker that had only modest benefit and made its behaviour much harder to reason about.
This is unlikely to have much user visible effect, but it is possible that in some cases shrinking may get slightly slower. It is primarily to make it easier to work on the shrinker and pave the way for future work.
This release improves the information that Hypothesis emits about its shrinking when ~hypothesis.settings.verbosity is set to debug.
This release improves the information that Hypothesis emits about its shrinking when ~hypothesis.settings.verbosity is set to debug.
This release improves the information that Hypothesis emits about its shrinking when verbosity is set to debug.
This patch includes some minor fixes in the documentation, and updates the minimum version of pytest to 3.0 (released August 2016).
This patch includes some minor fixes in the documentation, and updates the minimum version of pytest to 3.0 (released August 2016).
This release fixes a bug where difficult to shrink tests could sometimes trigger an internal assertion error inside the shrinker.
This release fixes a bug where difficult to shrink tests could sometimes trigger an internal assertion error inside the shrinker.
This patch ensures that Hypothesis fully supports Python 3.7, by upgrading ~hypothesis.strategies.from_type (1264) and fixing some minor issues in our
This patch ensures that Hypothesis fully supports Python 3.7, by upgrading ~hypothesis.strategies.from_type (1264) and fixing some minor issues in our test suite (1148).
This patch fixes the online docs for various extras, by ensuring that their dependencies are installed on readthedocs.io (1326).
This patch fixes the online docs for various extras, by ensuring that their dependencies are installed on readthedocs.io (1326).
This release improves the shrinker's ability to reorder examples.
This release improves the shrinker's ability to reorder examples.
For example, consider the following test:
import hypothesis.strategies as st
from hypothesis import given
@given(st.text(), st.text())
def test_non_equal(x, y):
assert x != y
Previously this could have failed with either of x="", y="0" or x="0", y="". Now it should always fail with x="", y="0".
This will allow the shrinker to produce more consistent results, especially in cases where test cases contain some ordered collection whose actual order does not matter.
This patch fixes inference in the ~hypothesis.strategies.builds strategy with subtypes of python:typing.NamedTuple, where the __init__ method is not u
This patch fixes inference in the ~hypothesis.strategies.builds strategy with subtypes of python:typing.NamedTuple, where the __init__ method is not useful for introspection. We now use the field types instead - thanks to James Uther for identifying this bug.
This patch fixes inference in the builds() strategy with subtypes of typing.NamedTuple , where the init method is not useful for introspection. We now use the field types instead - thanks to James Uther for identifying this bug.
This release improves the shrinker's ability to handle situations where there is an additive constraint between two values.
This release improves the shrinker's ability to handle situations where there is an additive constraint between two values.
For example, consider the following test:
import hypothesis.strategies as st
from hypothesis import given
@given(st.integers(), st.integers())
def test_does_not_exceed_100(m, n):
assert m + n < 100
Previously this could have failed with almost any pair (m, n) with 0 <= m <= n and m + n == 100. Now it should almost always fail with m=0, n=100.
This is a relatively niche specialisation, but can be useful in situations where e.g. a bug is triggered by an integer overflow.
This patch fixes a rare bug where an incorrect percentage drawtime could be displayed for a test, when the system clock was changed during a test runn
This patch fixes a rare bug where an incorrect percentage drawtime could be displayed for a test, when the system clock was changed during a test running under Python 2 (we use python:time.monotonic where it is available to avoid such problems). It also fixes a possible zero-division error that can occur when the underlying C library double-rounds an intermediate value in python:math.fsum and gets the least significant bit wrong.
The following misuses are now deprecated, and will be an error in a future version:
This release improves validation of the alphabet argument to the ~hypothesis.strategies.text strategy. The following misuses are now deprecated, and will be an error in a future version:
passing an unordered collection (such as set('abc')), which violates invariants about shrinking and reproducibility
passing an alphabet sequence with elements that are not strings
passing an alphabet sequence with elements that are not of length one, which violates any size constraints that may apply
Thanks to Sushobhit for adding these warnings (1329).
This release fixes a mostly theoretical bug where certain usage of the internal API could trigger an assertion error inside Hypothesis. It is unlikely
This release fixes a mostly theoretical bug where certain usage of the internal API could trigger an assertion error inside Hypothesis. It is unlikely that this problem is even possible to trigger through the public API.
This release fixes dependency information for coverage. Previously Hypothesis would allow installing coverage with any version, but it only works with
This release fixes dependency information for coverage. Previously Hypothesis would allow installing coverage with any version, but it only works with coverage 4.0 or later.
We now specify the correct metadata in our setup.py, so Hypothesis will only allow installation with compatible versions of coverage.
This patch ensures that stateful tests which raise an error from a pytest helper still print the sequence of steps taken to reach that point (1372). T
This patch ensures that stateful tests which raise an error from a pytest helper still print the sequence of steps taken to reach that point (1372). This reporting was previously broken because the helpers inherit directly from python:BaseException, and therefore require special handling to catch without breaking e.g. the use of ctrl-C to quit the test.
This release deprecates the max_shrinks setting in favor of an internal heuristic. If you need to avoid shrinking examples, use the ~hypothesis.settin…
This release deprecates the max_shrinks setting in favor of an internal heuristic. If you need to avoid shrinking examples, use the ~hypothesis.settings.phases setting instead. (1235)
This release fixes a bug where an internal assertion error could sometimes be triggered while shrinking a failing test.
This release fixes a bug where an internal assertion error could sometimes be triggered while shrinking a failing test.
This patch fixes type-checking errors in our vendored pretty-printer, which were ignored by our mypy config but visible for anyone else (whoops). Than
This patch fixes type-checking errors in our vendored pretty-printer, which were ignored by our mypy config but visible for anyone else (whoops). Thanks to Pi Delport for reporting 1359 so promptly.
This release adds an interface which can be used to insert a wrapper between the original test function and @given (1257). This will be particularly u
This release adds an interface which can be used to insert a wrapper between the original test function and @given (1257). This will be particularly useful for test runner extensions such as pytest-trio, but is not recommended for direct use by other users of Hypothesis.
This release adds a new mechanism to infer strategies for classes defined using attrs, based on the type, converter, or validator of each attribute. T
This release adds a new mechanism to infer strategies for classes defined using attrs, based on the type, converter, or validator of each attribute. This inference is now built in to ~hypothesis.strategies.builds and ~hypothesis.strategies.from_type.
On Python 2, ~hypothesis.strategies.from_type no longer generates instances of int when passed long, or vice-versa.
This release adds a new mechanism to infer strategies for classes defined using attrs , based on the type, converter, or validator of each attribute. This inference is now built in to builds() and from_type() .
On Python 2, from_type() no longer generates instances of int when passed long , or vice-versa.
This release adds :PEP:484 type hints to Hypothesis on a provisional basis, using the comment-based syntax for Python 2 compatibility.
This release adds PEP 484 type hints to Hypothesis on a provisional basis, using the comment-based syntax for Python 2 compatibility.
It also adds the py.typed marker specified in PEP 561. After you pip install hypothesis, mypy 0.590 or later will therefore type-check your use of our public interface!
This release adds PEP 484 type hints to Hypothesis on a provisional basis, using the comment-based syntax for Python 2 compatibility.
It also adds the py.typed marker specified in PEP 561 . After you pip install hypothesis , mypy 0.590 or later will therefore type-check your use of our public interface!
This release deprecates the use of ~hypothesis.settings as a context manager, the use of which is somewhat ambiguous.
This release deprecates the use of ~hypothesis.settings as a context manager, the use of which is somewhat ambiguous.
Users should define settings with global state or with the @settings(...) decorator.
Fixed a bug in generating an instance of a Django model from a strategy where the primary key is generated as part of the strategy. See details here .
Fixed a bug in generating an instance of a Django model from a strategy where the primary key is generated as part of the strategy. See details here.
Thanks to Tim Martin for this contribution.
This release adds the @initialize decorator for stateful testing (originally discussed in 1216). All @initialize rules will be called once each in an
This release adds the @initialize decorator for stateful testing (originally discussed in 1216). All @initialize rules will be called once each in an arbitrary order before any normal rule is called.
This is a no-op release to take into account some changes to the release process. It should have no user visible effect.
This is a no-op release to take into account some changes to the release process. It should have no user visible effect.
This adds support for partially sorting examples which cannot be fully sorted. For example, [5, 4, 3, 2, 1, 0] with a constraint that the first elemen
This adds support for partially sorting examples which cannot be fully sorted. For example, [5, 4, 3, 2, 1, 0] with a constraint that the first element needs to be larger than the last becomes [1, 2, 3, 4, 5, 0].
Thanks to Luke for contributing.
This patch uses python:random.getstate and python:random.setstate to restore the PRNG state after @given runs deterministic tests. Without restoring s
This patch uses python:random.getstate and python:random.setstate to restore the PRNG state after @given runs deterministic tests. Without restoring state, you might have noticed problems such as 1266. The fix also applies to stateful testing (702).
This patch uses random.getstate() and random.setstate() to restore the PRNG state after @given runs deterministic tests. Without restoring state, you might have noticed problems such as issue #1266 . The fix also applies to stateful testing ( issue #702 ).
This release adds the ~hypothesis.strategies.emails strategy, which generates unicode strings representing an email address.
This release adds the ~hypothesis.strategies.emails strategy, which generates unicode strings representing an email address.
Thanks to Sushobhit for moving this to the public API (162).
This improves the shrinker. It can now reorder examples: 3 1 2 becomes 1 2 3.
This improves the shrinker. It can now reorder examples: 3 1 2 becomes 1 2 3.
Thanks to Luke for contributing.
This adds a new extra func:~hypothesis.extra.dateutil.timezones strategy that generates dateutil timezones .
This adds a new extra ~hypothesis.extra.dateutil.timezones strategy that generates dateutil timezones.
Thanks to Conrad for contributing.
This adds a new extra timezones() strategy that generates dateutil timezones .
Thanks to Conrad for contributing.
Using an unordered collection with the ~hypothesis.strategies.permutations strategy has been deprecated because the order in which e.g. a set shrinks…
Using an unordered collection with the ~hypothesis.strategies.permutations strategy has been deprecated because the order in which e.g. a set shrinks is arbitrary. This may cause different results between runs.
This release makes hypothesis.settings.define_setting a private method, which has the effect of hiding it from the documentation.
This release makes hypothesis.settings.define_setting a private method, which has the effect of hiding it from the documentation.
This is another release with no functionality changes as part of changes to Hypothesis's new release tagging scheme.
This is another release with no functionality changes as part of changes to Hypothesis's new release tagging scheme.
This is a release with no functionality changes that moves Hypothesis over to a new release tagging scheme.
This is a release with no functionality changes that moves Hypothesis over to a new release tagging scheme.
This release provides a performance improvement for most tests, but in particular users of ~hypothesis.strategies.sampled_from who don't have numpy in
This release provides a performance improvement for most tests, but in particular users of ~hypothesis.strategies.sampled_from who don't have numpy installed should see a significant performance improvement.
This patch contains further internal work to support Mypy. There are no user-visible changes... yet.
This patch contains further internal work to support Mypy. There are no user-visible changes... yet.
This patch contains some internal refactoring to run mypy in CI. There are no user-visible changes.
This patch contains some internal refactoring to run mypy in CI. There are no user-visible changes.
This release involves some very minor internal clean up and should have no user visible effect at all.
This release involves some very minor internal clean up and should have no user visible effect at all.
This release fixes a problem introduced in 3.56.0 where setting the hypothesis home directory (through currently undocumented means) would no longer r
This release fixes a problem introduced in 3.56.0 where setting the hypothesis home directory (through currently undocumented means) would no longer result in the default database location living in the new home directory.
This release fixes a problem introduced in 3.56.0 where setting ~hypothesis.settings.max_examples to 1 would result in tests failing with Unsatisfiabl
This release fixes a problem introduced in 3.56.0 where setting ~hypothesis.settings.max_examples to 1 would result in tests failing with Unsatisfiable. This problem could also occur in other harder to trigger circumstances (e.g. by setting it to a low value, having a hard to satisfy assumption, and disabling health checks).
…environment variable was, rather than deprecated, actually broken due to being read before various setup the deprecation path needed was done. It now…
This release fixes a problem that was introduced in 3.56.0: Use of the HYPOTHESIS_VERBOSITY_LEVEL environment variable was, rather than deprecated, actually broken due to being read before various setup the deprecation path needed was done. It now works correctly (and emits a deprecation warning).
This release deprecates several redundant or internally oriented ~hypothesis.settings, working towards an orthogonal set of configuration options that…
This release deprecates several redundant or internally oriented ~hypothesis.settings, working towards an orthogonal set of configuration options that are widely useful without requiring any knowledge of our internals (535).
Deprecated settings that no longer have any effect are no longer shown in the __repr__ unless set to a non-default value.
hypothesis.settings.perform_health_check is deprecated, as it duplicates ~hypothesis.settings.suppress_health_check.
hypothesis.settings.max_iterations is deprecated and disabled, because we can usually get better behaviour from an internal heuristic than a user-controlled setting.
hypothesis.settings.min_satisfying_examples is deprecated and disabled, due to overlap with the ~hypothesis.HealthCheck.filter_too_much healthcheck and poor interaction with ~hypothesis.settings.max_examples.
HYPOTHESIS_VERBOSITY_LEVEL is now deprecated. Set ~hypothesis.settings.verbosity through the profile system instead.
Examples tried by find() are now reported at debug verbosity level (as well as verbose level).
This release fixes a somewhat obscure condition (1230) under which you could occasionally see a failing test trigger an assertion error inside Hypothe
This release fixes a somewhat obscure condition (1230) under which you could occasionally see a failing test trigger an assertion error inside Hypothesis instead of failing normally.
This patch fixes one possible cause of 966. When running Python 2 with hash randomisation, passing a python:bytes object to python:random.seed would u
This patch fixes one possible cause of 966. When running Python 2 with hash randomisation, passing a python:bytes object to python:random.seed would use version=1, which broke ~hypothesis.settings.derandomize (because the seed depended on a randomised hash). If ~hypothesis.settings.derandomize is still nondeterministic for you, please open an issue.
This patch fixes one possible cause of issue #966 . When running Python 2 with hash randomisation, passing a bytes object to random.seed() would use version=1 , which broke derandomize (because the seed depended on a randomised hash). If derandomize is still nondeterministic for you, please open an issue.
This patch makes a variety of minor improvements to the documentation, and improves a few validation messages for invalid inputs.
This patch makes a variety of minor improvements to the documentation, and improves a few validation messages for invalid inputs.
This release updates the URL metadata associated with the PyPI package (again). It has no other user visible effects.
This release updates the URL metadata associated with the PyPI package (again). It has no other user visible effects.
This release updates the URL metadata associated with the PyPI package. It has no other user visible effects.
This release updates the URL metadata associated with the PyPI package. It has no other user visible effects.
This patch relaxes constraints in our tests on the expected values returned by the standard library function ~python:math.hypot and the internal helpe
This patch relaxes constraints in our tests on the expected values returned by the standard library function ~python:math.hypot and the internal helper function cathetus, to fix near-exact test failures on some 32-bit systems used by downstream packagers.
The HYPOTHESIS_DATABASE_FILE environment variable is deprecated, in favor of ~hypothesis.settings.load_profile and the ~hypothesis.settings.database s…
This release includes several improvements to the handling of the ~hypothesis.settings.database setting.
The database_file setting was a historical artefact, and you should just use ~hypothesis.settings.database directly.
The HYPOTHESIS_DATABASE_FILE environment variable is deprecated, in favor of ~hypothesis.settings.load_profile and the ~hypothesis.settings.database setting.
If you have not configured the example database at all and the default location is not usable (due to e.g. permissions issues), Hypothesis will fall back to an in-memory database. This is not persisted between sessions, but means that the defaults work on read-only filesystems.
This release improves the ~hypothesis.strategies.complex_numbers strategy, which now supports min_magnitude and max_magnitude arguments, along with al
This release improves the ~hypothesis.strategies.complex_numbers strategy, which now supports min_magnitude and max_magnitude arguments, along with allow_nan and allow_infinity like for ~hypothesis.strategies.floats.
Thanks to J.J. Green for this feature.
This release improves the complex_numbers() strategy, which now supports min_magnitude and max_magnitude arguments, along with allow_nan and allow_infinity like for floats() .
Thanks to J.J. Green for this feature.
Your coding agent can read these notes before it upgrades. Set up the MCP server →