NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI, #384 most downloaded on PyPI
The property-based testing library for Python
Latest stable
6.170.17
Last release today
20 Nov 2026
Ships on a steady schedule
a new release about every 9 days
Nearly every release is documented
notes for 60 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
14 years old
1596 releases · first in 2013
Drag across the ruler to compare, or tap a release to open it.
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.
Your coding agent can read these notes before it upgrades. Set up the MCP server →
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.
This release adds the ~hypothesis.extra.django.from_form function, which allows automatic testing against Django forms. (35)
This release adds the ~hypothesis.extra.django.from_form function, which allows automatic testing against Django forms. (35)
Thanks to Paul Stiverson for this feature, which resolves our oldest open issue!
This release deprecates HealthCheck.hung_test and disables the associated runtime check for tests that ran for more than five minutes. Such a check is…
This release deprecates HealthCheck.hung_test and disables the associated runtime check for tests that ran for more than five minutes. Such a check is redundant now that we enforce the deadline and max_examples setting, which can be adjusted independently.
This release adds a new module, hypothesis.extra.lark, which you can use to generate strings matching a context-free grammar.
This release adds a new module, hypothesis.extra.lark, which you can use to generate strings matching a context-free grammar.
In this initial version, only lark-parser EBNF grammars are supported, by the new hypothesis.extra.lark.from_lark function.
This patch fixes a very rare overflow bug (1748) which could raise an InvalidArgument error in ~hypothesis.strategies.complex_numbers even though the
This patch fixes a very rare overflow bug (1748) which could raise an InvalidArgument error in ~hypothesis.strategies.complex_numbers even though the arguments were valid.
This release makes some improvements to internal code organisation and documentation and has no impact on behaviour.
This release makes some improvements to internal code organisation and documentation and has no impact on behaviour.
This release adds ~hypothesis.register_random, which registers random.Random instances or compatible objects to be seeded and reset by Hypothesis to e
This release adds ~hypothesis.register_random, which registers random.Random instances or compatible objects to be seeded and reset by Hypothesis to ensure that test cases are deterministic.
We still recommend explicitly passing a random.Random instance from ~hypothesis.strategies.randoms if possible, but registering a framework-global state for Hypothesis to manage is better than flaky tests!
This patch fixes 1387, where bounded ~hypothesis.strategies.integers with a very large range would almost always generate very large numbers. Now, we
This patch fixes 1387, where bounded ~hypothesis.strategies.integers with a very large range would almost always generate very large numbers. Now, we usually use the same tuned distribution as unbounded ~hypothesis.strategies.integers.
This patch fixes issue #1387 , where bounded integers() with a very large range would almost always generate very large numbers. Now, we usually use the same tuned distribution as unbounded integers() .
This release randomizes the order in which the shrinker tries some of its initial normalization operations. You are unlikely to see much difference as
This release randomizes the order in which the shrinker tries some of its initial normalization operations. You are unlikely to see much difference as a result unless your generated examples are very large. In this case you may see some performance improvements in shrinking.
There are no new features here, as we release those in minor versions. Instead, 4.0 is a chance for us to remove deprecated features (many already con…
Welcome to the next major version of Hypothesis!
There are no new features here, as we release those in minor versions. Instead, 4.0 is a chance for us to remove deprecated features (many already converted into no-ops), and turn a variety of warnings into errors.
If you were running on the last version of Hypothesis 3.x without any Hypothesis deprecation warnings (or using private APIs), this will be a very boring upgrade. In fact, nothing will change for you at all. Per our deprecation policy, warnings added in the last six months (after 2018-07-05) have not been converted to errors.
hypothesis.extra.datetime has been removed, replaced by the core date and time strategies.
hypothesis.extra.fakefactory has been removed, replaced by general expansion of Hypothesis' strategies and the third-party ecosystem.
The SQLite example database backend has been removed.
The ~hypothesis.settings.deadline is now enforced by default, rather than just emitting a warning when the default (200 milliseconds per test case) deadline is exceeded.
The database_file setting has been removed; use ~hypothesis.settings.database.
The perform_health_check setting has been removed; use ~hypothesis.settings.suppress_health_check.
The max_shrinks setting has been removed; use ~hypothesis.settings.phases to disable shrinking.
The min_satisfying_examples, max_iterations, strict, timeout, and use_coverage settings have been removed without user-configurable replacements.
The elements argument is now required for collection strategies.
The average_size argument was a no-op and has been removed.
Date and time strategies now only accept min_value and max_value for bounds.
~hypothesis.strategies.builds now requires that the thing to build is passed as the first positional argument.
Alphabet validation for ~hypothesis.strategies.text raises errors, not warnings, as does category validation for ~hypothesis.strategies.characters.
The choices() strategy has been removed. Instead, you can use ~hypothesis.strategies.data with ~hypothesis.strategies.sampled_from, so choice(elements) becomes data.draw(sampled_from(elements)).
The streaming() strategy has been removed. Instead, you can use ~hypothesis.strategies.data and replace iterating over the stream with data.draw() calls.
~hypothesis.strategies.sampled_from and ~hypothesis.strategies.permutations raise errors instead of warnings if passed a collection that is not a sequence.
Applying @given to a test function multiple times was really inefficient, and now it's also an error.
Using the .example() method of a strategy (intended for interactive exploration) within another strategy or a test function always weakened data generation and broke shrinking, and now it's an error too.
The HYPOTHESIS_DATABASE_FILE environment variable is no longer supported, as the database_file setting has been removed.
The HYPOTHESIS_VERBOSITY_LEVEL environment variable is no longer supported. You can use the --hypothesis-verbosity pytest argument instead, or write your own setup code using the settings profile system to replace it.
Using @seed or derandomize=True now forces database=None to ensure results are in fact reproducible. If ~hypothesis.settings.database is not None, doing so also emits a HypothesisWarning.
Unused exception types have been removed from hypothesis.errors; namely AbnormalExit, BadData, BadTemplateDraw, DefinitelyNoSuchExample, Timeout, and WrongFormat.
This changes the order that the shrinker tries certain operations in its "emergency" phase which runs late in the process. The new order should be bet
This changes the order that the shrinker tries certain operations in its "emergency" phase which runs late in the process. The new order should be better at avoiding long stalls where the shrinker is failing to make progress, which may be helpful if you have difficult to shrink test cases. However this will not be noticeable in the vast majority of use cases.
This is a pure refactoring release that extracts some logic from the core Hypothesis engine into its own class and file. It should have no user visibl
This is a pure refactoring release that extracts some logic from the core Hypothesis engine into its own class and file. It should have no user visible impact.
This patch fixes some markup in our documentation.
This patch fixes some markup in our documentation.
Introduces hypothesis.stateful.multiple, which allows rules in rule based state machines to send multiple results at once to their target Bundle, or n
Introduces hypothesis.stateful.multiple, which allows rules in rule based state machines to send multiple results at once to their target Bundle, or none at all.
hypothesis.extra.django.models.models() is deprecated in favor of hypothesis.extra.django.from_model.
This release contains a massive cleanup of the Hypothesis for Django extra:
hypothesis.extra.django.models.models() is deprecated in favor of hypothesis.extra.django.from_model.
hypothesis.extra.django.models.add_default_field_mapping() is deprecated in favor of hypothesis.extra.django.register_field_strategy.
~hypothesis.extra.django.from_model does not infer a strategy for nullable fields or fields with a default unless passed infer, like ~hypothesis.strategies.builds. models.models() would usually but not always infer, and a special default_value marker object was required to disable inference.
This release improves some internal logic about when a test case in Hypothesis's internal representation could lead to a valid test case. In some circ
This release improves some internal logic about when a test case in Hypothesis's internal representation could lead to a valid test case. In some circumstances this can lead to a significant speed up during shrinking. It may have some minor negative impact on the quality of the final result due to certain shrink passes now having access to less information about test cases in some circumstances, but this should rarely matter.
This release has no user visible changes but updates our URLs to use HTTPS.
This release has no user visible changes but updates our URLs to use HTTPS.
Hypothesis can now automatically generate values for Django models with a ~django.db.models.URLField, thanks to a new provisional strategy for URLs (1
Hypothesis can now automatically generate values for Django models with a ~django.db.models.URLField, thanks to a new provisional strategy for URLs (1388).
Hypothesis can now automatically generate values for Django models with a URLField , thanks to a new provisional strategy for URLs ( issue #1388 ).
This release is a pure refactoring that extracts some internal code into its own file. It should have no user visible effect.
This release is a pure refactoring that extracts some internal code into its own file. It should have no user visible effect.
This is a docs-only patch, which fixes some typos and removes a few hyperlinks for deprecated features.
This is a docs-only patch, which fixes some typos and removes a few hyperlinks for deprecated features.
This release changes the order in which the shrinker tries to delete data. For large and slow tests this may significantly improve the performance of
This release changes the order in which the shrinker tries to delete data. For large and slow tests this may significantly improve the performance of shrinking.
This release fixes a bug where certain places Hypothesis internal errors could be raised during shrinking when a user exception occurred that suppress
This release fixes a bug where certain places Hypothesis internal errors could be raised during shrinking when a user exception occurred that suppressed an exception Hypothesis uses internally in its generation.
The two known ways to trigger this problem were:
Errors raised in stateful tests' teardown function.
Errors raised in finally blocks that wrapped a call to data.draw.
These cases will now be handled correctly.
This patch is a docs-only change to fix a broken hyperlink.
This patch is a docs-only change to fix a broken hyperlink.
This patch fixes 1732, where ~hypothesis.strategies.integers would always return long values on Python 2.
This patch fixes 1732, where ~hypothesis.strategies.integers would always return long values on Python 2.
This patch fixes issue #1732 , where integers() would always return long values on Python 2.
This release ensures that infinite numbers are never generated by ~hypothesis.strategies.floats with allow_infinity=False, which could previously happ
This release ensures that infinite numbers are never generated by ~hypothesis.strategies.floats with allow_infinity=False, which could previously happen in some cases where one bound was also provided.
The trivially inconsistent min_value=inf, allow_infinity=False now raises an InvalidArgumentError, as does the inverse with max_value. You can still use just(inf) to generate inf without violating other constraints.
Happy new year everyone! This release has no user visible changes but updates our copyright headers to include 2019.
Happy new year everyone! This release has no user visible changes but updates our copyright headers to include 2019.
This release makes a small change to the way the shrinker works. You may see some improvements to speed of shrinking on especially large and hard to s
This release makes a small change to the way the shrinker works. You may see some improvements to speed of shrinking on especially large and hard to shrink examples, but most users are unlikely to see much difference.
This patch fixes 1700, where a line that contained a Unicode character before a lambda definition would cause an internal exception.
This patch fixes 1700, where a line that contained a Unicode character before a lambda definition would cause an internal exception.
Introduces the hypothesis.stateful.consumes function. When defining a rule in stateful testing, it can be used to mark bundles from which values shoul
Introduces the hypothesis.stateful.consumes function. When defining a rule in stateful testing, it can be used to mark bundles from which values should be consumed, i. e. removed after use in the rule. This has been proposed in 136.
Thanks to Jochen Müller for this long-awaited feature.
This patch makes a small internal change to fix an issue in Hypothesis's own coverage tests (1718).
This patch makes a small internal change to fix an issue in Hypothesis's own coverage tests (1718).
There is no user-visible change.
This patch refactors the hypothesis.strategies module, so that private names should no longer appear in tab-completion lists. We previously relied on
This patch refactors the hypothesis.strategies module, so that private names should no longer appear in tab-completion lists. We previously relied on __all__ for this, but not all editors respect it.
This is a follow-up patch to ensure that the deprecation date is automatically recorded for any new deprecations. There is no user-visible effect.
This is a follow-up patch to ensure that the deprecation date is automatically recorded for any new deprecations. There is no user-visible effect.
This patch updates the Hypothesis pytest plugin to avoid a recently deprecated hook interface. There is no user-visible change.
This patch updates the Hypothesis pytest plugin to avoid a recently deprecated hook interface. There is no user-visible change.
This patch fixes the internals for ~hypothesis.strategies.integers with one bound. Values from this strategy now always shrink towards zero instead of
This patch fixes the internals for ~hypothesis.strategies.integers with one bound. Values from this strategy now always shrink towards zero instead of towards the bound, and should shrink much more efficiently too. On Python 2, providing a bound incorrectly excluded long integers, which can now be generated.
This patch adds information about when features were deprecated, but this is only recorded internally and has no user-visible effect.
This patch adds information about when features were deprecated, but this is only recorded internally and has no user-visible effect.
This release changes the stateful testing backend from find() to use @given (1300). This doesn't change how you create stateful tests, but does make t
This release changes the stateful testing backend from find() to use @given (1300). This doesn't change how you create stateful tests, but does make them run more like other Hypothesis tests.
@reproduce_failure and @seed now work for stateful tests.
Stateful tests now respect the ~hypothesis.settings.deadline and ~hypothesis.settings.suppress_health_check settings, though they are disabled by default. You can enable them by using @settings(...) as a class decorator with whatever arguments you prefer.
One column per quarter.