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 adds a temporary hook for a downstream tool, which is not part of the public API.
This patch adds a temporary hook for a downstream tool, which is not part of the public API.
This release updates our copyright headers to use a general authorship statement and omit the year __.
This release updates our copyright headers to use a general authorship statement and omit the year.
One column per quarter.
This patch makes the .example() method more representative of test-time data generation, albeit often at a substantial cost to readability (3182).
This patch makes the .example() method more representative of test-time data generation, albeit often at a substantial cost to readability (3182).
This patch improves annotations on some of Hypothesis' internal functions, in order to deobfuscate the signatures of some strategies. In particular, s
This patch improves annotations on some of Hypothesis' internal functions, in order to deobfuscate the signatures of some strategies. In particular, strategies shared between hypothesis.extra.numpy and the hypothesis.extra.array_api extra will benefit from this patch.
This patch fix invariants display in stateful falsifying examples (3185).
This patch fix invariants display in stateful falsifying examples (3185).
This patch updates xps.indices so no flat indices are generated, i.e. generated indices will now always explicitly cover each axes of an array if no e
This patch updates xps.indices so no flat indices are generated, i.e. generated indices will now always explicitly cover each axes of an array if no ellipsis is present. This is to be consistent with a specification change that dropped support for flat indexing (#272).
…timezones (though we respect the new USE_DEPRECATED_PYTZ setting if you need it).
This release makes us compatible with Django 4.0, in particular by adding support for use of zoneinfo timezones (though we respect the new USE_DEPRECATED_PYTZ setting if you need it).
This patch updates our vendored list of top-level domains __, which is used by the provisional ~hypothesis.provisional.domains strategy.
This patch updates our vendored list of top-level domains, which is used by the provisional ~hypothesis.provisional.domains strategy.
This release adds an allow_subnormal argument to the ~hypothesis.strategies.floats strategy, which can explicitly toggle the generation of subnormal f
This release adds an allow_subnormal argument to the ~hypothesis.strategies.floats strategy, which can explicitly toggle the generation of subnormal floats (3155). Disabling such generation is useful when testing flush-to-zero builds of libraries.
nps.from_dtype() and xps.from_dtype can also accept the allow_subnormal argument, and xps.from_dtype or xps.arrays will disable subnormals by default if the array module xp is detected to flush-to-zero (like is typical with CuPy).
This patch fixes a bug in ~hypothesis.extra.numpy.mutually_broadcastable_shapes, which restricted the patterns of singleton dimensions that could be g
This patch fixes a bug in ~hypothesis.extra.numpy.mutually_broadcastable_shapes, which restricted the patterns of singleton dimensions that could be generated for dimensions that extended beyond base_shape (3170).
This patch clarifies our pretty-printing of DataFrames (3114).
This patch clarifies our pretty-printing of DataFrames (3114).
This patch documents ~hypothesis.strategies.timezones Windows-only requirement __ for the tzdata package, and ensures that pip install hypothesis[zone
This patch documents ~hypothesis.strategies.timezones Windows-only requirement for the tzdata package, and ensures that pip install hypothesis[zoneinfo] will install the latest version.
This release teaches ~hypothesis.strategies.builds to use ~hypothesis.strategies.deferred when resolving unrecognised type hints, so that you can conv
This release teaches ~hypothesis.strategies.builds to use ~hypothesis.strategies.deferred when resolving unrecognised type hints, so that you can conveniently register strategies for recursive types with constraints on some arguments (3026):
class RecursiveClass:
def __init__(self, value: int, next_node: typing.Optional["SomeClass"]):
assert value > 0
self.value = value
self.next_node = next_node
st.register_type_strategy(
RecursiveClass, st.builds(RecursiveClass, value=st.integers(min_value=1))
)
This release fixes some internal calculations related to collection sizes (3143).
This release fixes some internal calculations related to collection sizes (3143).
This release modifies our pytest plugin, to avoid importing Hypothesis and therefore triggering Hypothesis' entry points for test suites where Hypothe
This release modifies our pytest plugin, to avoid importing Hypothesis and therefore triggering Hypothesis' entry points for test suites where Hypothesis is installed but not actually used (3140).
This release fixes 3080, where ~hypothesis.strategies.from_type failed on unions containing 585 builtin generic types (like list[int]) in Python 3.9 a
This release fixes 3080, where ~hypothesis.strategies.from_type failed on unions containing 585 builtin generic types (like list[int]) in Python 3.9 and later.
This release fixes issue #3080 , where from_type() failed on unions containing PEP 585 builtin generic types (like list[int] ) in Python 3.9 and later.
This patch makes the hypothesis codemod command somewhat faster.
This patch makes the hypothesis codemod command somewhat faster.
This patch changes the backing datastructures of ~hypothesis.register_random and a few internal caches to use weakref.WeakValueDictionary. This reduce
This patch changes the backing datastructures of ~hypothesis.register_random and a few internal caches to use weakref.WeakValueDictionary. This reduces memory usage and may improve performance when registered ~random.Random instances are only used for a subset of your tests (3131).
This release teaches Hypothesis' multiple-error reporting to format tracebacks using pytest or better-exceptions, if they are installed and enabled (3
This release teaches Hypothesis' multiple-error reporting to format tracebacks using pytest or better-exceptions, if they are installed and enabled (3116).
Did you know that of the 2\ 64 possible floating-point numbers, 2\ 53 of them are nan - and Python prints them all the same way?
Did you know that of the 264 possible floating-point numbers, 253 of them are nan - and Python prints them all the same way?
While nans usually have all zeros in the sign bit and mantissa, this isn't always true, and 'signaling' nans might trap or error. To help distinguish such errors in e.g. CI logs, Hypothesis now prints -nan for negative nans, and adds a comment like # Saw 3 signaling NaNs if applicable.
This release adds special filtering logic to make a few special cases like s.map(lambda x: x) and lists().filter(len) more efficient (2701).
This release adds special filtering logic to make a few special cases like s.map(lambda x: x) and lists().filter(len) more efficient (2701).
This patch makes ~hypothesis.strategies.floats generate "subnormal" floating point numbers more often, as these rare values can have strange interacti
This patch makes ~hypothesis.strategies.floats generate "subnormal" floating point numbers more often, as these rare values can have strange interactions with unsafe compiler optimisations like -ffast-math (2976).
This patch fixes a rare internal error in the ~hypothesis.strategies.datetimes strategy, where the implementation of allow_imaginary=False crashed whe
This patch fixes a rare internal error in the ~hypothesis.strategies.datetimes strategy, where the implementation of allow_imaginary=False crashed when checking a time during the skipped hour of a DST transition if the DST offset is negative - only true of Europe/Dublin, who we presume have their reasons - and the tzinfo object is a pytz timezone (which predates 495).
This patch gives Hypothesis it's own internal ~random.Random instance, ensuring that test suites which reset the global random state don't induce weir
This patch gives Hypothesis it's own internal ~random.Random instance, ensuring that test suites which reset the global random state don't induce weird correlations between property-based tests (2135).
This patch updates documentation of ~hypothesis.note (3147).
This patch updates documentation of ~hypothesis.note (3147).
This patch updates internal testing for the Array API extra to be consistent with new specification changes: sum() not accepting boolean arrays (#234
This patch updates our vendored list of top-level domains __, which is used by the provisional ~hypothesis.provisional.domains strategy.
This patch updates our vendored list of top-level domains, which is used by the provisional ~hypothesis.provisional.domains strategy.
This patch updates our vendored list of top-level domains __, which is used by the provisional ~hypothesis.provisional.domains strategy.
This patch updates our vendored list of top-level domains, which is used by the provisional ~hypothesis.provisional.domains strategy.
(did you know that gTLDs can be both added and removed?)
This patch adds an error for when shapes in xps.arrays() is not passed as either a valid shape or strategy.
This patch adds an error for when shapes in xps.arrays() is not passed as either a valid shape or strategy.
This patch updates our formatting with shed.
This patch updates our formatting with shed.
This patch replaces external links to NumPy API docs with sphinx.ext.intersphinx cross-references. It is purely a documentation improvement.
This patch replaces external links to NumPy API docs with sphinx.ext.intersphinx cross-references. It is purely a documentation improvement.
This patch cleans up internal logic for xps.arrays(). There is no user-visible change.
This patch cleans up internal logic for xps.arrays(). There is no user-visible change.
This release follows pytest in considering SystemExit and GeneratorExit exceptions to be test failures, meaning that we will shink to minimal examples
This release follows pytest in considering SystemExit and GeneratorExit exceptions to be test failures, meaning that we will shink to minimal examples and check for flakiness even though they subclass BaseException directly (2223).
KeyboardInterrupt continues to interrupt everything, and will be re-raised immediately.
This release adds ~hypothesis.extra.django.LiveServerTestCase and ~hypothesis.extra.django.StaticLiveServerTestCase for django test. Thanks to Ivan Th
This release adds ~hypothesis.extra.django.LiveServerTestCase and ~hypothesis.extra.django.StaticLiveServerTestCase for django test. Thanks to Ivan Tham for this feature!
This release adds LiveServerTestCase and StaticLiveServerTestCase for django test. Thanks to Ivan Tham for this feature!
This patch fixes some new linter warnings such as flake8-bugbear's B904 for explicit exception chaining, so tracebacks might be a bit nicer.
This patch fixes some new linter warnings such as flake8-bugbear's B904 for explicit exception chaining, so tracebacks might be a bit nicer.
This release fixes None being inferred as the float64 dtype in ~xps.from_dtype() and ~xps.arrays() from the Array API extra .
This release fixes None being inferred as the float64 dtype in ~xps.from_dtype() and ~xps.arrays() from the Array API extra.
This release fixes None being inferred as the float64 dtype in from_dtype() and arrays() from the Array API extra .
This release fixes the type hint for the @given() decorator when decorating an async function (3099).
This release fixes the type hint for the @given() decorator when decorating an async function (3099).
This release improves Ghostwritten tests for builtins (2977).
This release improves Ghostwritten tests for builtins (2977).
This release deprecates use of both min_dims > len(shape) and max_dims > len(shape) when allow_newaxis == False in ~hypothesis.extra.numpy.basic_indic…
This release deprecates use of both min_dims > len(shape) and max_dims > len(shape) when allow_newaxis == False in ~hypothesis.extra.numpy.basic_indices (3091).
This release improves the behaviour of ~hypothesis.strategies.builds and ~hypothesis.strategies.from_type in certain situations involving decorators (
This release improves the behaviour of ~hypothesis.strategies.builds and ~hypothesis.strategies.from_type in certain situations involving decorators (2495 and 3029).
This release improves the behaviour of builds() and from_type() in certain situations involving decorators ( issue #2495 and issue #3029 ).
This release introduces strategies for array/tensor libraries adopting the Array API standard __ (3037). They are available in the hypothesis.extra.ar
This release introduces strategies for array/tensor libraries adopting the Array API standard (3037). They are available in the hypothesis.extra.array_api extra, and work much like the existing strategies for NumPy.
This patch fixes 961, where calling given() inline on a bound method would fail to handle the self argument correctly.
This patch fixes 961, where calling given() inline on a bound method would fail to handle the self argument correctly.
This release allows ~hypothesis.strategies.slices to generate step=None, and fixes an off-by-one error where the start index could be equal to size. T
This release allows ~hypothesis.strategies.slices to generate step=None, and fixes an off-by-one error where the start index could be equal to size. This works fine for all Python sequences and Numpy arrays, but is undefined behaviour in the Array API standard (see 3065).
Using a ~hypothesis.stateful.consumes bundle as a target is deprecated, and will be an error in a future version.
This release makes stateful testing more likely to tell you if you do something unexpected and unsupported:
The ~hypothesis.HealthCheck.return_value health check now applies to ~hypothesis.stateful.rule and ~hypothesis.stateful.initialize rules, if they don't have target bundles, as well as ~hypothesis.stateful.invariant.
Using a ~hypothesis.stateful.consumes bundle as a target is deprecated, and will be an error in a future version.
If existing code triggers these new checks, check for related bugs and misunderstandings - these patterns never had any effect.
This release makes stateful testing more likely to tell you if you do something unexpected and unsupported:
The return_value health check now applies to rule() and initialize() rules, if they don’t have target bundles, as well as invariant() .
Using a consumes() bundle as a target is deprecated, and will be an error in a future version.
If existing code triggers these new checks, check for related bugs and misunderstandings - these patterns never had any effect.
This release teaches ~hypothesis.strategies.from_type a neat trick: when resolving an python:typing.Annotated type, if one of the annotations is a str
This release teaches ~hypothesis.strategies.from_type a neat trick: when resolving an python:typing.Annotated type, if one of the annotations is a strategy object we use that as the inferred strategy. For example:
PositiveInt = Annotated[int, st.integers(min_value=1)]
If there are multiple strategies, we use the last outer-most annotation. See 2978 and 3082 for discussion.
Requires Python 3.9 or later for get_type_hints(..., include_extras=False).
This patch makes unique ~hypothesis.extra.numpy.arrays much more efficient, especially when there are only a few valid elements - such as for eight-bi
This patch makes unique ~hypothesis.extra.numpy.arrays much more efficient, especially when there are only a few valid elements - such as for eight-bit integers (3066).
This patch fixes the repr of ~hypothesis.extra.numpy.array_shapes.
This patch fixes the repr of ~hypothesis.extra.numpy.array_shapes.
This patch wraps some internal helper code in our proxies decorator to prevent mutations of method docstrings carrying over to other instances of the
This patch wraps some internal helper code in our proxies decorator to prevent mutations of method docstrings carrying over to other instances of the respective methods.
This patch moves some internal helper code in preparation for 3065. There is no user-visible change, unless you depended on undocumented internals.
This patch moves some internal helper code in preparation for 3065. There is no user-visible change, unless you depended on undocumented internals.
This release adds type annotations to the stateful testing API.
This release adds type annotations to the stateful testing API.
Thanks to Ruben Opdebeeck for this contribution!
This release adds the ~hypothesis.strategies.DrawFn type as a reusable type hint for the draw argument of @composite functions.
This release adds the ~hypothesis.strategies.DrawFn type as a reusable type hint for the draw argument of @composite functions.
Thanks to Ruben Opdebeeck for this contribution!
This release emits a more useful error message when @given() is applied to a coroutine function, i.e. one defined using async def (3054).
This release emits a more useful error message when @given() is applied to a coroutine function, i.e. one defined using async def (3054).
This was previously only handled by the generic ~hypothesis.HealthCheck.return_value health check, which doesn't direct you to use either a custom executor or a library such as pytest-trio or pytest-asyncio to handle it for you.
This patch fixes a regression in Hypothesis 6.14.8, where ~hypothesis.strategies.from_type failed to resolve types which inherit from multiple paramet
This patch fixes a regression in Hypothesis 6.14.8, where ~hypothesis.strategies.from_type failed to resolve types which inherit from multiple parametrised generic types, affecting the returns package (3060).
This patch ensures that registering a strategy for a subclass of a parametrised generic type such as class Lines(Sequence[str]): will not "leak" into
This patch ensures that registering a strategy for a subclass of a parametrised generic type such as class Lines(Sequence[str]): will not "leak" into unrelated strategies such as st.from_type(Sequence[int]) (2951). Unfortunately this fix requires 560, meaning Python 3.7 or later.
This patch fixes 3050, where attrs classes could cause an internal error in the ghostwriter .
This patch fixes 3050, where attrs classes could cause an internal error in the ghostwriter.
This patch improves the error message for 3016, where 585 builtin generics with self-referential forward-reference strings cannot be resolved to a str
This patch improves the error message for 3016, where 585 builtin generics with self-referential forward-reference strings cannot be resolved to a strategy by ~hypothesis.strategies.from_type.
This patch improves the error message for issue #3016 , where PEP 585 builtin generics with self-referential forward-reference strings cannot be resolved to a strategy by from_type() .
This patch fixes hypothesis.strategies._internal.types.is_a_new_type. It was failing on Python 3.10.0b4, where NewType is a function.
This patch fixes hypothesis.strategies._internal.types.is_a_new_type. It was failing on Python 3.10.0b4, where NewType is a function.
This patch fixes ~hypothesis.strategies.from_type and ~hypothesis.strategies.register_type_strategy for python:typing.NewType on Python 3.10, which ch
This patch fixes ~hypothesis.strategies.from_type and ~hypothesis.strategies.register_type_strategy for python:typing.NewType on Python 3.10, which changed the underlying implementation (see 44353 for details).
This patch fixes from_type() and register_type_strategy() for typing.NewType on Python 3.10, which changed the underlying implementation (see bpo-44353 for details).
This patch updates our autoformatting tools, improving our code style without any API changes.
This patch updates our autoformatting tools, improving our code style without any API changes.
This patch ensures that we shorten tracebacks for tests which fail due to inconsistent data generation between runs (i.e. raise Flaky).
This patch ensures that we shorten tracebacks for tests which fail due to inconsistent data generation between runs (i.e. raise Flaky).
Your coding agent can read these notes before it upgrades. Set up the MCP server →