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 release fixes a bug that prevented ~hypothesis.strategies.random_module from correctly restoring the previous state of the random module.
This release fixes a bug that prevented ~hypothesis.strategies.random_module from correctly restoring the previous state of the random module.
The random state was instead being restored to a temporary deterministic state, which accidentally caused subsequent tests to see the same random values across multiple test runs.
This patch adds an internal special case to make sampled_from(...).filter(...) much more efficient when the filter rejects most elements (1885).
This patch adds an internal special case to make sampled_from(...).filter(...) much more efficient when the filter rejects most elements (1885).
One column per quarter.
This patch improves the error message if the function f in s.flatmap(f) does not return a strategy.
This patch improves the error message if the function f in s.flatmap(f) does not return a strategy.
Thanks to Kai Chen for this change!
This release modifies how Hypothesis selects operations to run during shrinking, by causing it to deprioritise previously useless classes of shrink un
This release modifies how Hypothesis selects operations to run during shrinking, by causing it to deprioritise previously useless classes of shrink until others have reached a fixed point.
This avoids certain pathological cases where the shrinker gets very close to finishing and then takes a very long time to finish the last small changes because it tries many useless shrinks for each useful one towards the end. It also should cause a more modest improvement (probably no more than about 30%) in shrinking performance for most tests.
This release blocks installation of Hypothesis on Python 3.4, which :PEP:reached its end of life date on 2019-03-18 <429>.
This release blocks installation of Hypothesis on Python 3.4, which :PEP:`reached its end of life date on 2019-03-18 <429>`.
This should not be of interest to anyone but downstream maintainers - if you are affected, migrate to a secure version of Python as soon as possible or at least seek commercial support.
floats(min_value=0.0, max_value=-0.0) is now deprecated. While 0. == -0. and we could thus generate either if comparing by value, violating the sequen…
This release makes it an explicit error to call floats(min_value=inf, exclude_min=True) or floats(max_value=-inf, exclude_max=True), as there are no possible values that can be generated (1859).
floats(min_value=0.0, max_value=-0.0) is now deprecated. While 0. == -0. and we could thus generate either if comparing by value, violating the sequence ordering of floats is a special case we don't want or need.
This release should significantly reduce the amount of memory that Hypothesis uses for representing large test cases, by storing information in a more
This release should significantly reduce the amount of memory that Hypothesis uses for representing large test cases, by storing information in a more compact representation and only unpacking it lazily when it is first needed.
This update adds the ~hypothesis.settings.report_multiple_bugs setting, which you can use to disable multi-bug reporting and only raise whichever bug
This update adds the ~hypothesis.settings.report_multiple_bugs setting, which you can use to disable multi-bug reporting and only raise whichever bug had the smallest minimal example. This is occasionally useful when using a debugger or tools that annotate tracebacks via introspection.
This change makes a tiny improvement to the core engine's bookkeeping. There is no user-visible change.
This change makes a tiny improvement to the core engine's bookkeeping. There is no user-visible change.
This release changes some of Hypothesis's internal shrinking behaviour in order to reduce memory usage and hopefully improve performance.
This release changes some of Hypothesis's internal shrinking behaviour in order to reduce memory usage and hopefully improve performance.
This release adds a micro-optimisation to how Hypothesis handles debug reporting internally. Hard to shrink test may see a slight performance improvem
This release adds a micro-optimisation to how Hypothesis handles debug reporting internally. Hard to shrink test may see a slight performance improvement, but in most common scenarios it is unlikely to be noticeable.
This release removes some redundant code that was no longer needed but was still running a significant amount of computation and allocation on the hot
This release removes some redundant code that was no longer needed but was still running a significant amount of computation and allocation on the hot path. This should result in a modest speed improvement for most tests, especially those with large test cases.
This release adds a micro-optimisation to how Hypothesis caches test cases. This will cause a small improvement in speed and memory usage for large te
This release adds a micro-optimisation to how Hypothesis caches test cases. This will cause a small improvement in speed and memory usage for large test cases, but in most common scenarios it is unlikely to be noticeable.
This release removes some internal code that populates a field that is no longer used anywhere. This should result in some modest performance and spee
This release removes some internal code that populates a field that is no longer used anywhere. This should result in some modest performance and speed improvements and no other user visible effects.
This is a formatting-only patch, enabled by a new version of isort.
This is a formatting-only patch, enabled by a new version of isort.
This release deprecates ~hypothesis.strategies.sampled_from with empty sequences. This returns ~hypothesis.strategies.nothing, which gives a clear err…
This release deprecates ~hypothesis.strategies.sampled_from with empty sequences. This returns ~hypothesis.strategies.nothing, which gives a clear error if used directly... but simply vanishes if combined with another strategy.
Tests that silently generate less than expected are a serious problem for anyone relying on them to find bugs, and we think reliability more important than convenience in this case.
This release improves Hypothesis's to detect flaky tests, by noticing when the behaviour of the test changes between runs. In particular this will not
This release improves Hypothesis's to detect flaky tests, by noticing when the behaviour of the test changes between runs. In particular this will notice many new cases where data generation depends on external state (e.g. external sources of randomness) and flag those as flaky sooner and more reliably.
The basis of this feature is a considerable reengineering of how Hypothesis stores its history of test cases, so on top of this its memory usage should be considerably reduced.
This release adds the strategy ~hypothesis.extra.numpy.valid_tuple_axes, which generates tuples of axis-indices that can be passed to the axis argumen
This release adds the strategy ~hypothesis.extra.numpy.valid_tuple_axes, which generates tuples of axis-indices that can be passed to the axis argument in NumPy's sequential functions (e.g. numpy:numpy.sum).
Thanks to Ryan Soklaski for this strategy.
As usual, this replaces existing errors with a more helpful error and starts new validation checks as deprecation warnings.
This release significantly tightens validation in hypothesis.settings. ~hypothesis.settings.max_examples, buffer_size, and ~hypothesis.settings.stateful_step_count must be positive integers; ~hypothesis.settings.deadline must be a positive number or None; and ~hypothesis.settings.derandomize must be either True or False.
As usual, this replaces existing errors with a more helpful error and starts new validation checks as deprecation warnings.
This release significantly tightens validation in hypothesis.settings . max_examples , buffer_size , and stateful_step_count must be positive integers; deadline must be a positive number or None ; and derandomize must be either True or False .
As usual, this replaces existing errors with a more helpful error and starts new validation checks as deprecation warnings.
This release makes some micro-optimisations to certain calculations performed in the shrinker. These should particularly speed up large test cases whe
This release makes some micro-optimisations to certain calculations performed in the shrinker. These should particularly speed up large test cases where the shrinker makes many small changes. It will also reduce the amount allocated, but most of this is garbage that would have been immediately thrown away, so you probably won't see much effect specifically from that.
This patch removes some overhead from ~hypothesis.extra.numpy.arrays with a constant shape and dtype. The resulting performance improvement is modest,
This patch removes some overhead from ~hypothesis.extra.numpy.arrays with a constant shape and dtype. The resulting performance improvement is modest, but worthwhile for small arrays.
This release makes some micro-optimisations within Hypothesis's internal representation of test cases. This should cause heavily nested test cases to
This release makes some micro-optimisations within Hypothesis's internal representation of test cases. This should cause heavily nested test cases to allocate less during generation and shrinking, which should speed things up slightly.
This changes the order in which Hypothesis runs certain operations during shrinking. This should significantly decrease memory usage and speed up shri
This changes the order in which Hypothesis runs certain operations during shrinking. This should significantly decrease memory usage and speed up shrinking of large examples.
This release allows Hypothesis to calculate a number of attributes of generated test cases lazily. This should significantly reduce memory usage and m
This release allows Hypothesis to calculate a number of attributes of generated test cases lazily. This should significantly reduce memory usage and modestly improve performance, especially for large test cases.
This release reduces the number of operations the shrinker will try when reordering parts of a test case. This should in some circumstances significan
This release reduces the number of operations the shrinker will try when reordering parts of a test case. This should in some circumstances significantly speed up shrinking. It may result in different final test cases, and if so usually slightly worse ones, but it should not generally have much impact on the end result as the operations removed were typically useless.
This release changes how Hypothesis reorders examples within a test case during shrinking. This should make shrinking considerably faster.
This release changes how Hypothesis reorders examples within a test case during shrinking. This should make shrinking considerably faster.
This release slightly improves the shrinker's ability to replace parts of a test case with their minimal version, by allowing it to do so in bulk rath
This release slightly improves the shrinker's ability to replace parts of a test case with their minimal version, by allowing it to do so in bulk rather than one at a time. Where this is effective, shrinker performance should be modestly improved.
This release makes some micro-optimisations to common operations performed during shrinking. Shrinking should now be slightly faster, especially for l
This release makes some micro-optimisations to common operations performed during shrinking. Shrinking should now be slightly faster, especially for large examples with relatively fast test functions.
This release is a purely internal refactoring of Hypothesis's API for representing test cases. There should be no user visible effect.
This release is a purely internal refactoring of Hypothesis's API for representing test cases. There should be no user visible effect.
This release changes certain shrink passes to make them more efficient when they aren't making progress.
This release changes certain shrink passes to make them more efficient when they aren't making progress.
This patch removes some unused code, which makes the internals a bit easier to understand. There is no user-visible impact.
This patch removes some unused code, which makes the internals a bit easier to understand. There is no user-visible impact.
This release reduces the number of operations the shrinker will try when reordering parts of a test case. This should in some circumstances significan
This release reduces the number of operations the shrinker will try when reordering parts of a test case. This should in some circumstances significantly speed up shrinking. It may result in different final test cases, and if so usually slightly worse ones, but it should not generally have much impact on the end result as the operations removed were typically useless.
This patch removes some unused code from the shrinker. There is no user-visible change.
This patch removes some unused code from the shrinker. There is no user-visible change.
This release changes certain shrink passes to make them *adaptive* - that is, in cases where they are successfully making progress they may now do so
This release changes certain shrink passes to make them adaptive - that is, in cases where they are successfully making progress they may now do so significantly faster.
This is a docs-only patch, noting that because the lark-parser is under active development at version 0.x, hypothesis[lark] APIs may break in minor re
This is a docs-only patch, noting that because the lark-parser is under active development at version 0.x, hypothesis[lark] APIs may break in minor releases if necessary to keep up with the upstream package.
This changes Hypothesis to no longer import various test frameworks by default (if they are installed). which will speed up the initial import hypothe
This changes Hypothesis to no longer import various test frameworks by default (if they are installed). which will speed up the initial import hypothesis call.
This release changes Hypothesis's internal representation of a test case to calculate some expensive structural information on demand rather than eage
This release changes Hypothesis's internal representation of a test case to calculate some expensive structural information on demand rather than eagerly. This should reduce memory usage a fair bit, and may make generation somewhat faster.
This release refactors the internal representation of previously run test cases. The main thing you should see as a result is that Hypothesis becomes
This release refactors the internal representation of previously run test cases. The main thing you should see as a result is that Hypothesis becomes somewhat less memory hungry.
This patch allows ~hypothesis.extra.numpy.array_shapes to generate shapes with side-length or even dimension zero, though the minimum still defaults t
This patch allows ~hypothesis.extra.numpy.array_shapes to generate shapes with side-length or even dimension zero, though the minimum still defaults to one. These shapes are rare and have some odd behavior, but are particularly important to test for just that reason!
In a related bigfix, ~hypothesis.extra.numpy.arrays now supports generating zero-dimensional arrays with dtype=object and a strategy for iterable elements. Previously, the array element would incorrectly be set to the first item in the generated iterable.
Thanks to Ryan Turner for continuing to improve our Numpy support.
This release is a trivial micro-optimisation inside Hypothesis which should result in it using significantly less memory.
This release is a trivial micro-optimisation inside Hypothesis which should result in it using significantly less memory.
This release changes some inconsistent behavior of ~hypothesis.extra.numpy.arrays from the Numpy extra when asked for an array of shape=(). ~hypothesi
This release changes some inconsistent behavior of ~hypothesis.extra.numpy.arrays from the Numpy extra when asked for an array of shape=(). ~hypothesis.extra.numpy.arrays will now always return a Numpy ~numpy:numpy.ndarray, and the array will always be of the requested dtype.
Thanks to Ryan Turner for this change.
This release changes some inconsistent behavior of arrays() from the Numpy extra when asked for an array of shape=() . arrays() will now always return a Numpy ndarray , and the array will always be of the requested dtype.
Thanks to Ryan Turner for this change.
This release fixes a minor typo in an internal comment. There is no user-visible change.
This release fixes a minor typo in an internal comment. There is no user-visible change.
This release fixes 1813, a bug introduced in 3.59.1 , which caused meth:~hypothesis.strategies.random_module to no longer affect the body of the test:
This release fixes 1813, a bug introduced in 3.59.1, which caused ~hypothesis.strategies.random_module to no longer affect the body of the test: Although Hypothesis would claim to be seeding the random module in fact tests would always run with a seed of zero.
This patch fixes an off-by-one error in the maximum length of ~hypothesis.strategies.emails. Thanks to Krzysztof Jurewicz for 1812.
This patch fixes an off-by-one error in the maximum length of ~hypothesis.strategies.emails. Thanks to Krzysztof Jurewicz for 1812.
This patch fixes an off-by-one error in the maximum length of emails() . Thanks to Krzysztof Jurewicz for pull request #1812 .
This patch removes some unused code from the shrinker. There is no user-visible change.
This patch removes some unused code from the shrinker. There is no user-visible change.
This release fixes an internal IndexError in Hypothesis that could sometimes be triggered during shrinking.
This release fixes an internal IndexError in Hypothesis that could sometimes be triggered during shrinking.
This release modifies the shrinker to interleave different types of reduction operations, e.g. switching between deleting data and lowering scalar val
This release modifies the shrinker to interleave different types of reduction operations, e.g. switching between deleting data and lowering scalar values rather than trying entirely deletions then entirely lowering.
This may slow things down somewhat in the typical case, but has the major advantage that many previously difficult to shrink examples should become much faster, because the shrinker will no longer tend to stall when trying some ineffective changes to the shrink target but will instead interleave it with other more effective operations.
This release makes a number of internal changes to the implementation of hypothesis.extra.lark.from_lark. These are primarily intended as a refactorin
This release makes a number of internal changes to the implementation of hypothesis.extra.lark.from_lark. These are primarily intended as a refactoring, but you may see some minor improvements to performance when generating large strings, and possibly to shrink quality.
This patch prints an explanatory note when 1798 is triggered, because the error message from Numpy is too terse to locate the problem.
This patch prints an explanatory note when 1798 is triggered, because the error message from Numpy is too terse to locate the problem.
In Python 2, long integers are not allowed in the shape argument to ~hypothesis.extra.numpy.arrays. Thanks to Ryan Turner for fixing this.
In Python 2, long integers are not allowed in the shape argument to ~hypothesis.extra.numpy.arrays. Thanks to Ryan Turner for fixing this.
In Python 2, long integers are not allowed in the shape argument to arrays() . Thanks to Ryan Turner for fixing this.
This release makes a small internal refactoring to clarify how Hypothesis instructs tests to stop running when appropriate. There is no user-visible c
This release makes a small internal refactoring to clarify how Hypothesis instructs tests to stop running when appropriate. There is no user-visible change.
This release standardises all of the shrinker's internal operations on running in a random order.
This release standardises all of the shrinker's internal operations on running in a random order.
The main effect you will see from this that it should now be much less common for the shrinker to stall for a long time before making further progress. In some cases this will correspond to shrinking more slowly, but on average it should result in faster shrinking.
This patch updates some docstrings, but has no runtime changes.
This patch updates some docstrings, but has no runtime changes.
This release adds exclude_min and exclude_max arguments to ~hypothesis.strategies.floats, so that you can easily generate values from open or half-ope
This release adds exclude_min and exclude_max arguments to ~hypothesis.strategies.floats, so that you can easily generate values from open or half-open intervals (1622).
This patch fixes a bug where ~hypothesis.strategies.from_regex could throw an internal error if the python:re.IGNORECASE flag was used (1786).
This patch fixes a bug where ~hypothesis.strategies.from_regex could throw an internal error if the python:re.IGNORECASE flag was used (1786).
This patch fixes a bug where from_regex() could throw an internal error if the re.IGNORECASE flag was used ( issue #1786 ).
This release removes two shrink passes that Hypothesis runs late in the process. These were very expensive when the test function was slow and often d
This release removes two shrink passes that Hypothesis runs late in the process. These were very expensive when the test function was slow and often didn't do anything useful.
Shrinking should get faster for most failing tests. If you see any regression in example quality as a result of this release, please let us know.
This release modifies the way that Hypothesis deletes data during shrinking. It will primarily be noticeable for very large examples, which should now
This release modifies the way that Hypothesis deletes data during shrinking. It will primarily be noticeable for very large examples, which should now shrink faster.
The shrinker is now also able to perform some deletions that it could not previously, but this is unlikely to be very noticeable.
This release fixes an open file leak that used to cause ResourceWarning\ s.
This release fixes an open file leak that used to cause ResourceWarnings.
This release changes Hypothesis's internal approach to caching the results of executing test cases. The result should be that it is now significantly
This release changes Hypothesis's internal approach to caching the results of executing test cases. The result should be that it is now significantly less memory hungry, especially when shrinking large test cases.
Some tests may get slower or faster depending on whether the new or old caching strategy was well suited to them, but any change in speed in either direction should be minor.
This patch tightens up some of our internal heuristics to deal with shrinking floating point numbers, which will now run in fewer circumstances.
This patch tightens up some of our internal heuristics to deal with shrinking floating point numbers, which will now run in fewer circumstances.
You are fairly unlikely to see much difference from this, but if you do you are likely to see shrinking become slightly faster and/or producing slightly worse results.
Your coding agent can read these notes before it upgrades. Set up the MCP server →