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 today
05 Oct 2026
Ships on a steady schedule
a new release about every 1 weeks
Nearly every release is documented
notes for 58 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
14 years old
1573 releases · first in 2013
This release fixes two bugs in hypothesis.extra.numpy:
This release fixes two bugs in hypothesis.extra.numpy:
~hypothesis.extra.numpy.unicode_string_dtypes didn't work at all due to an incorrect dtype specifier. Now it does.
Various impossible conditions would have been accepted but would error when they fail to produced any example. Now they raise an explicit InvalidArgument error.
This is a bugfix release for 739, where bounds for ~hypothesis.strategies.fractions or floating-point ~hypothesis.strategies.decimals were not properl
This is a bugfix release for 739, where bounds for ~hypothesis.strategies.fractions or floating-point ~hypothesis.strategies.decimals were not properly converted to integers before passing them to the integers strategy. This excluded some values that should have been possible, and could trigger internal errors if the bounds lay between adjacent integers.
You can now bound ~hypothesis.strategies.fractions with two arbitrarily close fractions.
It is now an explicit error to supply a min_value, max_value, and max_denominator to ~hypothesis.strategies.fractions where the value bounds do not include a fraction with denominator at most max_denominator.
One column per quarter.
This release adds the ~hypothesis.strategies.from_regex strategy, which generates strings that contain a match of a regular expression.
This release adds the ~hypothesis.strategies.from_regex strategy, which generates strings that contain a match of a regular expression.
Thanks to Maxim Kulkin for creating the hypothesis-regex package and then helping to upstream it! (662)
This is a bugfix release for ~hypothesis.strategies.integers. Previously the strategy would hit an internal assertion if passed non-integer bounds for
This is a bugfix release for ~hypothesis.strategies.integers. Previously the strategy would hit an internal assertion if passed non-integer bounds for min_value and max_value that had no integers between them. The strategy now raises InvalidArgument instead.
Release to fix a bug where mocks can be used as test runners under certain conditions. Specifically, if a mock is injected into a test via pytest fixt
Release to fix a bug where mocks can be used as test runners under certain conditions. Specifically, if a mock is injected into a test via pytest fixtures or patch decorators, and that mock is the first argument in the list, hypothesis will think it represents self and turns the mock into a test runner. If this happens, the affected test always passes because the mock is executed instead of the test body. Sometimes, it will also fail health checks.
Fixes 491 and a section of 198. Thanks to Ben Peterson for this bug fix.
This release should improve the performance of some tests which experienced a slow down as a result of the 3.13.0 release.
This release should improve the performance of some tests which experienced a slow down as a result of the 3.13.0 release.
Tests most likely to benefit from this are ones that make extensive use of min_size parameters, but others may see some improvement as well.
This release fixes a bug introduced in 3.18.0 . If the arguments include_characters and exclude_characters to ~hypothesis.strategies.characters contai
This release fixes a bug introduced in 3.18.0. If the arguments include_characters and exclude_characters to ~hypothesis.strategies.characters contained overlapping elements, then an InvalidArgument exception would be raised.
Thanks to Zac Hatfield-Dodds for reporting and fixing this.
This is a bug fix release to fix 780, where ~hypothesis.strategies.sets and similar would trigger health check errors if their element strategy could
This is a bug fix release to fix 780, where ~hypothesis.strategies.sets and similar would trigger health check errors if their element strategy could only produce one element (e.g. if it was ~hypothesis.strategies.just).
~hypothesis.strategies.characters now accepts include_characters, particular characters which will be added to those it produces. (668)
This is a feature release:
~hypothesis.strategies.characters now accepts include_characters, particular characters which will be added to those it produces. (668)
A bug fix for the internal function _union_interval_lists(), and a rename to _union_intervals(). It now correctly handles all cases where intervals overlap, and it always returns the result as a tuple for tuples.
Thanks to Alex Willmer for these.
This release documents the previously undocumented phases feature in |Phase|, making it part of the public API. It also updates how the example databa
This release documents the previously undocumented phases feature in |Phase|, making it part of the public API. It also updates how the example database is used. Principally:
The ~hypothesis.Phase.reuse phase will now correctly control whether examples from the database are run (it previously did exactly the wrong thing and controlled whether examples would be saved).
Hypothesis will no longer try to rerun all previously failing examples. Instead it will replay the smallest previously failing example and a selection of other examples that are likely to trigger any other bugs that will found. This prevents a previous failure from dominating your tests unnecessarily.
As a result of the previous change, Hypothesis will be slower about clearing out old examples from the database that are no longer failing (because it can only clear out ones that it actually runs).
This release makes an implementation change to how Hypothesis handles certain internal constructs.
This release makes an implementation change to how Hypothesis handles certain internal constructs.
The main effect you should see is improvement to the behaviour and performance of collection types, especially ones with a min_size parameter. Many cases that would previously fail due to being unable to generate enough valid examples will now succeed, and other cases should run slightly faster.
This release introduces a deprecation of the timeout feature. This results in the following changes:
This release introduces a deprecation of the timeout feature. This results in the following changes:
Creating a settings object with an explicit timeout will emit a deprecation warning.
If your test stops because it hits the timeout (and has not found a bug) then it will emit a deprecation warning.
There is a new value unlimited which you can import from hypothesis. settings(timeout=unlimited) will not cause a deprecation warning.
There is a new health check, hung_test, which will trigger after a test has been running for five minutes if it is not suppressed.
This release deprecates two strategies, choices() and streaming().
This release deprecates two strategies, choices() and streaming().
Both of these are somewhat confusing to use and are entirely redundant since the introduction of the ~hypothesis.strategies.data strategy for interactive drawing in tests, and their use should be replaced with direct use of ~hypothesis.strategies.data instead.
This fixes a bug where Hypothesis would not work correctly on Python 2.7 if you had the python:typing module backport installed.
This fixes a bug where Hypothesis would not work correctly on Python 2.7 if you had the python:typing module backport installed.
This raises the maximum depth at which Hypothesis starts cutting off data generation to a more reasonable value which it is harder to hit by accident.
This raises the maximum depth at which Hypothesis starts cutting off data generation to a more reasonable value which it is harder to hit by accident.
This resolves (751), in which some examples which previously worked would start timing out, but it will also likely improve the data generation quality for complex data types.
Hypothesis now understands inline type annotations (293):
Hypothesis now understands inline type annotations (293):
If the target of ~hypothesis.strategies.builds has type annotations, a default strategy for missing required arguments is selected based on the type. Type-based strategy selection will only override a default if you pass hypothesis.infer as a keyword argument.
If @given wraps a function with type annotations, you can pass ~hypothesis.infer as a keyword argument and the appropriate strategy will be substituted.
You can check what strategy will be inferred for a type with the new ~hypothesis.strategies.from_type function.
~hypothesis.strategies.register_type_strategy teaches Hypothesis which strategy to infer for custom or unknown types. You can provide a strategy, or for more complex cases a function which takes the type and returns a strategy.
This is a bug fix release for 514 - Hypothesis would continue running examples after a ~python:unittest.SkipTest exception was raised, including print
This is a bug fix release for 514 - Hypothesis would continue running examples after a ~python:unittest.SkipTest exception was raised, including printing a falsifying example. Skip exceptions from the standard python:unittest module, and pytest, nose, or unittest2 modules now abort the test immediately without printing output.
This release has two major aspects to it: The first is the introduction of ~hypothesis.strategies.deferred, which allows more natural definition of re
This release has two major aspects to it: The first is the introduction of ~hypothesis.strategies.deferred, which allows more natural definition of recursive (including mutually recursive) strategies.
The second is a number of engine changes designed to support this sort of strategy better. These should have a knock-on effect of also improving the performance of any existing strategies that currently generate a lot of data or involve heavy nesting by reducing their typical example size.
This release makes some major internal changes to how Hypothesis represents data internally, as a prelude to some major engine changes that should imp
This release makes some major internal changes to how Hypothesis represents data internally, as a prelude to some major engine changes that should improve data quality. There are no API changes, but it's a significant enough internal change that a minor version bump seemed warranted.
User facing impact should be fairly mild, but includes:
All existing examples in the database will probably be invalidated. Hypothesis handles this automatically, so you don't need to do anything, but if you see all your examples disappear that's why.
Almost all data distributions have changed significantly. Possibly for the better, possibly for the worse. This may result in new bugs being found, but it may also result in Hypothesis being unable to find bugs it previously did.
Data generation may be somewhat faster if your existing bottleneck was in draw_bytes (which is often the case for large examples).
Shrinking will probably be slower, possibly significantly.
If you notice any effects you consider to be a significant regression, please open an issue about them.
This release involves no functionality changes, but is the first to ship wheels as well as an sdist.
This release involves no functionality changes, but is the first to ship wheels as well as an sdist.
This release provides a performance improvement to shrinking. For cases where there is some non-trivial "boundary" value (e.g. the bug happens for all
This release provides a performance improvement to shrinking. For cases where there is some non-trivial "boundary" value (e.g. the bug happens for all values greater than some other value), shrinking should now be substantially faster. Other types of bug will likely see improvements too.
This may also result in some changes to the quality of the final examples - it may sometimes be better, but is more likely to get slightly worse in some edge cases. If you see any examples where this happens in practice, please report them.
This is a bugfix release: Hypothesis now prints explicit examples when running in verbose mode. (313)
This is a bugfix release: Hypothesis now prints explicit examples when running in verbose mode. (313)
This is a bugfix release: Hypothesis no longer emits a warning if you try to use ~hypothesis.strategies.sampled_from with python:collections.OrderedDi
This is a bugfix release: Hypothesis no longer emits a warning if you try to use ~hypothesis.strategies.sampled_from with python:collections.OrderedDict. (688)
This is a bugfix release: Hypothesis no longer emits a warning if you try to use sampled_from() with collections.OrderedDict . ( issue #688 )
This is a documentation release. Several outdated snippets have been updated or removed, and many cross-references are now hyperlinks.
This is a documentation release. Several outdated snippets have been updated or removed, and many cross-references are now hyperlinks.
This is a minor ergonomics release. Tracebacks shown by pytest no longer include Hypothesis internals for test functions decorated with @given .
This is a minor ergonomics release. Tracebacks shown by pytest no longer include Hypothesis internals for test functions decorated with @given.
The old dates, times, and datetimes strategies in hypothesis.extra.datetimes are deprecated in favor of the new core strategies, which are more flexib…
This is a feature release, adding datetime-related strategies to the core strategies.
~hypothesis.extra.pytz.timezones allows you to sample pytz timezones from the Olsen database. Use directly in a recipe for tz-aware datetimes, or compose with ~hypothesis.strategies.none to allow a mix of aware and naive output.
The new ~hypothesis.strategies.dates, ~hypothesis.strategies.times, ~hypothesis.strategies.datetimes, and ~hypothesis.strategies.timedeltas strategies are all constrained by objects of their type. This means that you can generate dates bounded by a single day (i.e. a single date), or datetimes constrained to the microsecond.
~hypothesis.strategies.times and ~hypothesis.strategies.datetimes take an optional timezones= argument, which defaults to ~hypothesis.strategies.none for naive times. You can use our extra strategy based on pytz, or roll your own timezones strategy with dateutil or even the standard library.
The old dates, times, and datetimes strategies in hypothesis.extra.datetimes are deprecated in favor of the new core strategies, which are more flexible and have no dependencies.
This is a feature release, adding datetime-related strategies to the core strategies.
timezones() allows you to sample pytz timezones from the Olsen database. Use directly in a recipe for tz-aware datetimes, or compose with none() to allow a mix of aware and naive output.
The new dates() , times() , datetimes() , and timedeltas() strategies are all constrained by objects of their type. This means that you can generate dates bounded by a single day (i.e. a single date), or datetimes constrained to the microsecond.
times() and datetimes() take an optional timezones= argument, which defaults to none() for naive times. You can use our extra strategy based on pytz, or roll your own timezones strategy with dateutil or even the standard library.
The old dates , times , and datetimes strategies in hypothesis.extra.datetimes are deprecated in favor of the new core strategies, which are more flexible and have no dependencies.
Hypothesis now uses python:inspect.getfullargspec internally. On Python 2, there are no visible changes.
Hypothesis now uses python:inspect.getfullargspec internally. On Python 2, there are no visible changes.
On Python 3 @given and @composite now preserve 3107 annotations on the decorated function. Keyword-only arguments are now either handled correctly (e.g. @composite), or caught in validation instead of silently discarded or raising an unrelated error later (e.g. @given).
This is a bugfix release: the default field mapping for a DateTimeField in the Django extra now respects the USE_TZ setting when choosing a strategy.
This is a bugfix release: the default field mapping for a DateTimeField in the Django extra now respects the USE_TZ setting when choosing a strategy.
This is feature release, expanding the capabilities of the ~hypothesis.strategies.decimals strategy.
This is feature release, expanding the capabilities of the ~hypothesis.strategies.decimals strategy.
The new (optional) places argument allows you to generate decimals with a certain number of places (e.g. cents, thousandths, satoshis).
If allow_infinity is None, setting min_bound no longer excludes positive infinity and setting max_value no longer excludes negative infinity.
All of NaN, -Nan, sNaN, and -sNaN may now be drawn if allow_nan is True, or if allow_nan is None and min_value or max_value is None.
min_value and max_value may be given as decimal strings, e.g. "1.234".
Hypothesis now imports python:sqlite3 when a SQLite database is used, rather than at module load, improving compatibility with Python implementations
Hypothesis now imports python:sqlite3 when a SQLite database is used, rather than at module load, improving compatibility with Python implementations compiled without SQLite support (such as BSD or Jython).
This is a compatibility bugfix release. ~hypothesis.strategies.sampled_from no longer raises a deprecation warning when sampling from an python:enum.E…
This is a compatibility bugfix release. ~hypothesis.strategies.sampled_from no longer raises a deprecation warning when sampling from an python:enum.Enum, as all enums have a reliable iteration order.
This is a compatibility bugfix release. sampled_from() no longer raises a deprecation warning when sampling from an enum.Enum , as all enums have a reliable iteration order.
This release removes a version check for older versions of pytest when using the Hypothesis pytest plugin. The pytest plugin will now run unconditiona
This release removes a version check for older versions of pytest when using the Hypothesis pytest plugin. The pytest plugin will now run unconditionally on all versions of pytest. This breaks compatibility with any version of pytest prior to 2.7.0 (which is more than two years old).
The primary reason for this change is that the version check was a frequent source of breakage when pytest change their versioning scheme. If you are not working on pytest itself and are not running a very old version of it, this release probably doesn't affect you.
This is a code reorganisation release that moves some internal test helpers out of the main source tree so as to not have changes to them trigger rele
This is a code reorganisation release that moves some internal test helpers out of the main source tree so as to not have changes to them trigger releases in future.
This is a documentation release. Almost all code examples are now doctests checked in CI, eliminating stale examples.
This is a documentation release. Almost all code examples are now doctests checked in CI, eliminating stale examples.
This is a feature release, adding the ~hypothesis.strategies.iterables strategy, equivalent to lists(...).map(iter) but with a much more useful repr.
This is a feature release, adding the ~hypothesis.strategies.iterables strategy, equivalent to lists(...).map(iter) but with a much more useful repr. You can use this strategy to check that code doesn't accidentally depend on sequence properties such as indexing support or repeated iteration.
This patch fixes a bug in 3.7.3 , where using @example and a pytest fixture in the same test could cause the test to fail to fill the arguments, and t
This patch fixes a bug in 3.7.3, where using @example and a pytest fixture in the same test could cause the test to fail to fill the arguments, and throw a TypeError.
This release should include no user visible changes and is purely a refactoring release. This modularises the behaviour of the core ~hypothesis.given
This release should include no user visible changes and is purely a refactoring release. This modularises the behaviour of the core ~hypothesis.given function, breaking it up into smaller and more accessible parts, but its actual behaviour should remain unchanged.
This reverts an undocumented change in 3.7.1 which broke installation on debian stable: The specifier for the hypothesis[django] extra\_requires had i
This reverts an undocumented change in 3.7.1 which broke installation on debian stable: The specifier for the hypothesis[django] extra_requires had introduced a wild card, which was not supported on the default version of pip.
This is a bug fix and internal improvements release.
This is a bug fix and internal improvements release.
In particular Hypothesis now tracks a tree of where it has already explored. This allows it to avoid some classes of duplicate examples, and significantly improves the performance of shrinking failing examples by allowing it to skip some shrinks that it can determine can't possibly work.
Hypothesis will no longer seed the global random arbitrarily unless you have asked it to using ~hypothesis.strategies.random_module
Shrinking would previously have not worked correctly in some special cases on Python 2, and would have resulted in suboptimal examples.
Rule based stateful testing now has an @invariant decorator that specifies methods that are run after init and after every step, allowing you to encod
This is a feature release.
New features:
Rule based stateful testing now has an @invariant decorator that specifies methods that are run after init and after every step, allowing you to encode properties that should be true at all times. Thanks to Tom Prince for this feature.
The ~hypothesis.strategies.decimals strategy now supports allow_nan and allow_infinity flags.
There are significantly more strategies available for numpy, including for generating arbitrary data types. Thanks to Zac Hatfield Dodds for this feature.
When using the ~hypothesis.strategies.data strategy you can now add a label as an argument to draw(), which will be printed along with the value when an example fails. Thanks to Peter Inglesby for this feature.
Bug fixes:
Bug fix: ~hypothesis.strategies.composite now preserves functions' docstrings.
The build is now reproducible and doesn't depend on the path you build it from. Thanks to Chris Lamb for this feature.
numpy strategies for the void data type did not work correctly. Thanks to Zac Hatfield Dodds for this fix.
There have also been a number of performance optimizations:
The ~hypothesis.strategies.permutations strategy is now significantly faster to use for large lists (the underlying algorithm has gone from O(n^2) to O(n)).
Shrinking of failing test cases should have got significantly faster in some circumstances where it was previously struggling for a long time.
Example generation now involves less indirection, which results in a small speedup in some cases (small enough that you won't really notice it except in pathological cases).
This release fixes a dependency problem and makes some small behind the scenes improvements.
This release fixes a dependency problem and makes some small behind the scenes improvements.
The fake-factory dependency was renamed to faker. If you were depending on it through hypothesis[django] or hypothesis[fake-factory] without pinning it yourself then it would have failed to install properly. This release changes it so that hypothesis[fakefactory] (which can now also be installed as hypothesis[faker]) will install the renamed faker package instead.
This release also removed the dependency of hypothesis[django] on hypothesis[fakefactory] - it was only being used for emails. These now use a custom strategy that isn't from fakefactory. As a result you should also see performance improvements of tests which generated User objects or other things with email fields, as well as better shrinking of email addresses.
The distribution of code using nested calls to ~hypothesis.strategies.one_of or the | operator for combining strategies has been improved, as branches are now flattened to give a more uniform distribution.
Examples using ~hypothesis.strategies.composite or |.flatmap| should now shrink better. In particular this will affect things which work by first generating a length and then generating that many items, which have historically not shrunk very well.
This release reverts Hypothesis to its old pretty printing of lambda functions based on attempting to extract the source code rather than decompile th
This release reverts Hypothesis to its old pretty printing of lambda functions based on attempting to extract the source code rather than decompile the bytecode. This is unfortunately slightly inferior in some cases and may result in you occasionally seeing things like lambda x: <unknown> in statistics reports and strategy reprs.
This removes the dependencies on uncompyle6, xdis and spark-parser.
The reason for this is that the new functionality was based on uncompyle6, which turns out to introduce a hidden GPLed dependency - it in turn depended on xdis, and although the library was licensed under the MIT license, it contained some GPL licensed source code and thus should have been released under the GPL.
My interpretation is that Hypothesis itself was never in violation of the GPL (because the license it is under, the Mozilla Public License v2, is fully compatible with being included in a GPL licensed work), but I have not consulted a lawyer on the subject. Regardless of the answer to this question, adding a GPLed dependency will likely cause a lot of users of Hypothesis to inadvertently be in violation of the GPL.
As a result, if you are running Hypothesis 3.5.x you really should upgrade to this release immediately.
If the same test was running concurrently in two processes and there were examples already in the test database which no longer failed, Hypothesis wou
This is a bug fix release.
Bugs fixed:
If the same test was running concurrently in two processes and there were examples already in the test database which no longer failed, Hypothesis would sometimes fail with a FileNotFoundError (IOError on Python 2) because an example it was trying to read was deleted before it was read. (372).
Drawing from an ~hypothesis.strategies.integers strategy with both a min_value and a max_value would reject too many examples needlessly. Now it repeatedly redraws until satisfied. (366. Thanks to Calen Pennington for the contribution).
The Hypothesis pytest plugin broke pytest support for doctests. Now it doesn't.
This is a bug fix release.
The Hypothesis pytest plugin broke pytest support for doctests. Now it doesn't.
Hypothesis now runs cleanly in -B and -BB modes, avoiding mixing bytes and unicode.
This is a bug fix release.
Hypothesis now runs cleanly in -B and -BB modes, avoiding mixing bytes and unicode.
python:unittest.TestCase tests would not have shown up in the new statistics mode. Now they do.
Similarly, stateful tests would not have shown up in statistics and now they do.
Statistics now print with pytest node IDs (the names you'd get in pytest verbose mode).
~hypothesis.strategies.fractions and ~hypothesis.strategies.decimals strategies now support min_value and max_value parameters. Thanks go to Anne Mulh
This is a feature release.
~hypothesis.strategies.fractions and ~hypothesis.strategies.decimals strategies now support min_value and max_value parameters. Thanks go to Anne Mulhern for the development of this feature.
The Hypothesis pytest plugin now supports a --hypothesis-show-statistics parameter that gives detailed statistics about the tests that were run. Huge thanks to Jean-Louis Fuchs and Adfinis-SyGroup for funding the development of this feature.
There is a new ~hypothesis.event function that can be used to add custom statistics.
Additionally there have been some minor bug fixes:
In some cases Hypothesis should produce fewer duplicate examples (this will mostly only affect cases with a single parameter).
pytest command line parameters are now under an option group for Hypothesis (thanks to David Keijser for fixing this)
Hypothesis would previously error if you used 3107 function annotations on your tests under Python 3.4.
The repr of many strategies using lambdas has been improved to include the lambda body (this was previously supported in many but not all cases).
This is a bug fix release, fixing a number of problems with the settings system:
This is a bug fix release, fixing a number of problems with the settings system:
Test functions defined using @given can now be called from other threads (337)
Attempting to delete a settings property would previously have silently done the wrong thing. Now it raises an AttributeError.
Creating a settings object with a custom database_file parameter was silently getting ignored and the default was being used instead. Now it's not.
This is a bug fix release for a single bug:
This is a bug fix release for a single bug:
On Windows when running two Hypothesis processes in parallel (e.g. using pytest-xdist) they could race with each other and one would raise an exception due to the non-atomic nature of file renaming on Windows and the fact that you can't rename over an existing file. This is now fixed.
This release is entirely provided by Lucas Wiman _:
This release is entirely provided by Lucas Wiman:
Strategies constructed by the Django extra will now respect much more of Django's validations out of the box. Wherever possible, ~django:django.db.models.Model.full_clean should succeed.
In particular:
The max_length, blank and choices kwargs are now respected.
Add support for DecimalField.
If a field includes validators, the list of validators are used to filter the field strategy.
This release went wrong and is functionally equivalent to 3.2.0 . Ignore it.
This release went wrong and is functionally equivalent to 3.2.0. Ignore it.
This is a small single-feature release:
This is a small single-feature release:
All tests using @given now fix the global random seed. This removes the health check for that. If a non-zero seed is required for the final falsifying example, it will be reported. Otherwise Hypothesis will assume randomization was not a significant factor for the test and be silent on the subject. If you use ~hypothesis.strategies.random_module this will continue to work and will always display the seed.
Another charmap problem. In 3.1.2 ~hypothesis.strategies.text and ~hypothesis.strategies.characters would break on systems which had /tmp mounted on a
Single bug fix release
Another charmap problem. In 3.1.2 ~hypothesis.strategies.text and ~hypothesis.strategies.characters would break on systems which had /tmp mounted on a different partition than the Hypothesis storage directory (usually in home). This fixes that.
Single bug fix release
Another charmap problem. In 3.1.2 text() and characters() would break on systems which had /tmp mounted on a different partition than the Hypothesis storage directory (usually in home). This fixes that.
Anything which used a ~hypothesis.strategies.text or ~hypothesis.strategies.characters strategy was broken on Windows and I hadn't updated appveyor to
Single bug fix release:
Anything which used a ~hypothesis.strategies.text or ~hypothesis.strategies.characters strategy was broken on Windows and I hadn't updated appveyor to use the new repository location so I didn't notice. This is now fixed and windows support should work correctly.
Fix concurrency issue when running tests that use ~hypothesis.strategies.text from multiple processes at once (302, thanks to Alex Chan).
Minor bug fix release.
Fix concurrency issue when running tests that use ~hypothesis.strategies.text from multiple processes at once (302, thanks to Alex Chan).
Improve performance of code using ~hypothesis.strategies.lists with max_size (thanks to Cristi Cobzarenco).
Fix install on Python 2 with ancient versions of pip so that it installs the enum34 backport (thanks to Donald Stufft for telling me how to do this).
Remove duplicated __all__ exports from hypothesis.strategies (thanks to Piët Delport).
Update headers to point to new repository location.
Allow use of strategies that can't be used in find() (e.g. choices()) in stateful testing.
Add a ~hypothesis.strategies.nothing strategy that never successfully generates values.
Add a ~hypothesis.strategies.nothing strategy that never successfully generates values.
~hypothesis.strategies.sampled_from and ~hypothesis.strategies.one_of can both now be called with an empty argument list, in which case they also never generate any values.
~hypothesis.strategies.one_of may now be called with a single argument that is a collection of strategies as well as varargs.
Add a ~hypothesis.strategies.runner strategy which returns the instance of the current test object if there is one.
'Bundle' for RuleBasedStateMachine is now a normal(ish) strategy and can be used as such.
Tests using RuleBasedStateMachine should now shrink significantly better.
Hypothesis now uses a pretty-printing library internally, compatible with IPython's pretty printing protocol (actually using the same code). This may improve the quality of output in some cases.
Add a 'phases' setting that allows more fine grained control over which parts of the process Hypothesis runs
Add a suppress_health_check setting which allows you to turn off specific health checks in a fine grained manner.
Fix a bug where lists of non fixed size would always draw one more element than they included. This mostly didn't matter, but if would cause problems with empty strategies or ones with side effects.
Add a mechanism to the Django model generator to allow you to explicitly request the default value (thanks to Jeremy Thurgood for this one).
Fix a bug where Hypothesis would now error on pytest development versions.
Fix a bug where Hypothesis would now error on pytest development versions.
Fix a bug where Hypothesis would error when running on Python 2.7.3 or earlier because it was trying to pass a python:bytearray object to python:struc
Fix a bug where Hypothesis would error when running on Python 2.7.3 or earlier because it was trying to pass a python:bytearray object to python:struct.unpack (which is only supported since 2.7.4).
Fix a bug where Hypothesis would error when running on Python 2.7.3 or earlier because it was trying to pass a bytearray object to struct.unpack() (which is only supported since 2.7.4).
Fix version parsing of pytest to work with pytest release candidates
Fix version parsing of pytest to work with pytest release candidates
More general handling of the health check problem where things could fail because of a cache miss - now one "free" example is generated before the start of the health check run.
Under certain circumstances, strategies involving ~hypothesis.strategies.text buried inside some other strategy (e.g. text().filter(...) or recursive(
Under certain circumstances, strategies involving ~hypothesis.strategies.text buried inside some other strategy (e.g. text().filter(...) or recursive(text(), ...)) would cause a test to fail its health checks the first time it ran. This was caused by having to compute some related data and cache it to disk. On travis or anywhere else where the .hypothesis directory was recreated this would have caused the tests to fail their health check on every run. This is now fixed for all the known cases, although there could be others lurking.
Fix a case where it was possible to trigger an "Unreachable" assertion when running certain flaky stateful tests.
Fix a case where it was possible to trigger an "Unreachable" assertion when running certain flaky stateful tests.
Improve shrinking of large stateful tests by eliminating a case where it was hard to delete early steps.
Improve efficiency of drawing binary(min_size=n, max_size=n) significantly by provide a custom implementation for fixed size blocks that can bypass a lot of machinery.
Set default home directory based on the current working directory at the point Hypothesis is imported, not whenever the function first happens to be called.
Your coding agent can read these notes before it upgrades. Set up the MCP server →