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 patch updates our vendored list of top-level domains __, which is used by the provisional ~hypothesis.provisional.domains strategy, and fixes som
This patch updates our vendored list of top-level domains, which is used by the provisional ~hypothesis.provisional.domains strategy, and fixes some incorrect examples in the docs for ~hypothesis.extra.numpy.mutually_broadcastable_shapes.
This patch updates our vendored list of top-level domains , which is used by the provisional domains() strategy, and fixes some incorrect examples in the docs for mutually_broadcastable_shapes() .
This patch improves the error message when Hypothesis detects "flush to zero" mode for floating-point: we now report which package(s) enabled this, wh
This patch improves the error message when Hypothesis detects "flush to zero" mode for floating-point: we now report which package(s) enabled this, which can make debugging much easier. See 3458 for details.
Your coding agent can read these notes before it upgrades. Set up the MCP server →
This release defines __bool__() on ~hypothesis.strategies.SearchStrategy. It always returns True, like before, but also emits a warning to help with c
This release defines __bool__() on ~hypothesis.strategies.SearchStrategy. It always returns True, like before, but also emits a warning to help with cases where you intended to draw a value (3463).
In preparation for future versions of the Array API standard __, ~hypothesis.extra.array_api.make_strategies_namespace now accepts an optional api_ver
In preparation for future versions of the Array API standard, ~hypothesis.extra.array_api.make_strategies_namespace now accepts an optional api_version argument, which determines the version conformed to by the returned strategies namespace. If None, the version of the passed array module xp is inferred.
This release also introduces xps.real_dtypes. This is currently equivalent to the existing xps.numeric_dtypes strategy, but exists because the latter is expected to include complex numbers in the next version of the standard.
If multiple explicit examples (from @example() ) raise a Skip exception, for consistency with generated examples we now re-raise the first instead of
If multiple explicit examples (from @example()) raise a Skip exception, for consistency with generated examples we now re-raise the first instead of collecting them into an ExceptionGroup (3453).
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 fixes some type annotations for Python 3.9 and earlier (3397), and teaches the |Phase.explain| phase about certain locations it should not
This patch fixes some type annotations for Python 3.9 and earlier (3397), and teaches the |Phase.explain| phase about certain locations it should not bother reporting (3439).
This patch teaches the Ghostwriter an additional check for function and class locations that should make it use public APIs more often.
This patch teaches the Ghostwriter an additional check for function and class locations that should make it use public APIs more often.
This patch fixes our workaround for a pytest bug where the inner exceptions in an ExceptionGroup are not displayed __ (3430).
This patch fixes our workaround for a pytest bug where the inner exceptions in an ExceptionGroup are not displayed (3430).
This patch makes FailedHealthCheck and DeadlineExceeded exceptions picklable, for compatibility with Django's parallel test runner (3426).
This patch makes FailedHealthCheck and DeadlineExceeded exceptions picklable, for compatibility with Django's parallel test runner (3426).
hypothesis.errors.MultipleFailures is therefore deprecated.
Reporting of multiple failing examples now uses the 654 ExceptionGroup type, which is provided by the exceptiongroup backport on Python 3.10 and earlier (3175). hypothesis.errors.MultipleFailures is therefore deprecated.
Failing examples and other reports are now stored as 678 exception notes, which ensures that they will always appear together with the traceback and other information about their respective error.
~hypothesis.extra.django.from_field now supports UsernameField from django.contrib.auth.forms.
~hypothesis.extra.django.from_field now supports UsernameField from django.contrib.auth.forms.
Thanks to Afonso Silva for reporting and working on 3417.
This patch improves the error message when you pass filenames to the hypothesis write CLI, which takes the name of a module or function (e.g. hypothes
This patch improves the error message when you pass filenames to the hypothesis write CLI, which takes the name of a module or function (e.g. hypothesis write gzip or hypothesis write package.some_function rather than hypothesis write script.py).
Thanks to Ed Rogers for implementing this as part of the SciPy 2022 sprints!
This patch ensures that the warning for non-interactive .example() points to your code instead of Hypothesis internals (3403).
This patch ensures that the warning for non-interactive .example() points to your code instead of Hypothesis internals (3403).
Thanks to @jameslamb for this fix.
This patch makes ~hypothesis.strategies.integers more likely to generate boundary values for large two-sided intervals (2942).
This patch makes ~hypothesis.strategies.integers more likely to generate boundary values for large two-sided intervals (2942).
This patch makes integers() more likely to generate boundary values for large two-sided intervals ( issue #2942 ).
This patch adds filter rewriting for math.isfinite, math.isinf, and math.isnan on ~hypothesis.strategies.integers or ~hypothesis.strategies.floats (27
This patch adds filter rewriting for math.isfinite, math.isinf, and math.isnan on ~hypothesis.strategies.integers or ~hypothesis.strategies.floats (2701).
Thanks to Sam Clamons at the SciPy Sprints!
This patch adds filter rewriting for math.isfinite() , math.isinf() , and math.isnan() on integers() or floats() ( issue #2701 ).
Thanks to Sam Clamons at the SciPy Sprints!
This release adds the allow_subnormal argument to ~hypothesis.strategies.complex_numbers by applying it to each of the real and imaginary parts separa
This release adds the allow_subnormal argument to ~hypothesis.strategies.complex_numbers by applying it to each of the real and imaginary parts separately. Closes 3390.
Thanks to Evan Tey for this fix.
Issue a deprecation warning if a function decorated with @composite does not draw any values (3384).
Issue a deprecation warning if a function decorated with @composite does not draw any values (3384).
Thanks to Grzegorz Zieba, Rodrigo Girão, and Thomas Ball for working on this at the EuroPython sprints!
This patch improves the error messages in @example() argument validation following the recent release of 6.49.1 .
This patch improves the error messages in @example() argument validation following the recent release of 6.49.1.
This release allows ~hypothesis.extra.numpy.from_dtype to generate Unicode strings which cannot be encoded in UTF-8, but are valid in Numpy arrays (wh
This release allows ~hypothesis.extra.numpy.from_dtype to generate Unicode strings which cannot be encoded in UTF-8, but are valid in Numpy arrays (which use UTF-32).
This logic will only be used with numpy >= 1.19, because earlier versions have an issue which led us to revert Hypothesis 5.2 last time!
This patch fixes some inconsistency between argument handling for @example and @given (2706 <2706#issuecomment-1168363177>).
This patch fixes some inconsistency between argument handling for @example and @given (2706).
This release uses 612 python:typing.ParamSpec (or the typing-extensions backport) to express the first-argument-removing behaviour of @st.composite an
This release uses 612 python:typing.ParamSpec (or the typing-extensions backport) to express the first-argument-removing behaviour of @st.composite and signature-preservation of ~hypothesis.strategies.functions to IDEs, editor plugins, and static type checkers such as mypy.
This release uses PEP 612 typing.ParamSpec (or the typing-extensions backport) to express the first-argument-removing behaviour of @st.composite and signature-preservation of functions() to IDEs, editor plugins, and static type checkers such as mypy .
hypothesis.event now works for hashable objects which do not support weakrefs, such as integers and tuples.
hypothesis.event now works for hashable objects which do not support weakrefs, such as integers and tuples.
This patch tidies up some internal introspection logic, which will improve support for positional-only arguments in a future release (2706).
This patch tidies up some internal introspection logic, which will improve support for positional-only arguments in a future release (2706).
This release automatically rewrites some simple filters, such as floats().filter(lambda x: x >= 10) to the more efficient floats(min_value=10), based
This release automatically rewrites some simple filters, such as floats().filter(lambda x: x >= 10) to the more efficient floats(min_value=10), based on the AST of the predicate.
We continue to recommend using the efficient form directly wherever possible, but this should be useful for e.g. pandera "Checks" where you already have a simple predicate and translating manually is really annoying. See 2701 for details.
This release raises ~unittest.SkipTest for tests which never executed any examples, for example because the ~hypothesis.settings.phases setting exclud
This release raises ~unittest.SkipTest for tests which never executed any examples, for example because the ~hypothesis.settings.phases setting excluded the ~hypothesis.Phase.explicit, ~hypothesis.Phase.reuse, and ~hypothesis.Phase.generate phases. This helps to avoid cases where broken tests appear to pass, because they didn't actually execute (3328).
This release raises SkipTest for tests which never executed any examples, for example because the phases setting excluded the explicit , reuse , and generate phases. This helps to avoid cases where broken tests appear to pass, because they didn’t actually execute ( issue #3328 ).
This patch fixes type annotations that had caused the signature of @given to be partially-unknown to type-checkers for Python versions before 3.10.
This patch fixes type annotations that had caused the signature of @given to be partially-unknown to type-checkers for Python versions before 3.10.
This patch fixes ~hypothesis.strategies.from_type on Python 3.11, following python/cpython#93754 __.
This patch fixes ~hypothesis.strategies.from_type on Python 3.11, following python/cpython#93754.
This patch fixes from_type() on Python 3.11, following python/cpython#93754 .
This patch makes the ~hypothesis.HealthCheck.too_slow health check more consistent with long ~hypothesis.settings.deadline tests (3367) and fixes an i
This patch makes the ~hypothesis.HealthCheck.too_slow health check more consistent with long ~hypothesis.settings.deadline tests (3367) and fixes an install issue under pipenv which was introduced in Hypothesis 6.47.2 (3374).
This patch makes the too_slow health check more consistent with long deadline tests ( issue #3367 ) and fixes an install issue under pipenv which was introduced in Hypothesis 6.47.2 ( issue #3374 ).
We now use the 654 ExceptionGroup __ type - provided by the exceptiongroup backport on older Pythons - to ensure that if multiple errors are raised in
We now use the 654 ExceptionGroup type - provided by the exceptiongroup backport on older Pythons - to ensure that if multiple errors are raised in teardown, they will all propagate.
We now use the PEP 654 ExceptionGroup type - provided by the exceptiongroup backport on older Pythons - to ensure that if multiple errors are raised in teardown, they will all propagate.
Our pretty-printer no longer sorts dictionary keys, since iteration order is stable in Python 3.7+ and this can affect reproducing examples (3370). Th
Our pretty-printer no longer sorts dictionary keys, since iteration order is stable in Python 3.7+ and this can affect reproducing examples (3370). This PR was kindly supported by Ordina Pythoneers.
The Ghostwriter can now write tests for @classmethod or @staticmethod methods, in addition to the existing support for functions and other callables (
The Ghostwriter can now write tests for @classmethod or @staticmethod methods, in addition to the existing support for functions and other callables (3318). Thanks to Cheuk Ting Ho for the patch.
Mention hypothesis.strategies.timezones in the documentation of hypothesis.strategies.datetimes for completeness.
Mention hypothesis.strategies.timezones in the documentation of hypothesis.strategies.datetimes for completeness.
Thanks to George Macon for this addition.
This release contains some small improvements to our documentation. Thanks to Felix Divo for his contribution!
This release contains some small improvements to our documentation. Thanks to Felix Divo for his contribution!
This patch by Adrian Garcia Badaracco adds type annotations to some private internals (3074).
This patch by Adrian Garcia Badaracco adds type annotations to some private internals (3074).
This patch by Phillip Schanely makes changes to the ~hypothesis.strategies.floats strategy when min_value or max_value is present. Hypothesis will now
This patch by Phillip Schanely makes changes to the ~hypothesis.strategies.floats strategy when min_value or max_value is present. Hypothesis will now be capable of generating every representable value in the bounds. You may notice that hypothesis is more likely to test values near boundaries, and values that are very close to zero.
These changes also support future integrations with symbolic execution tools and fuzzers (3086).
This patch updates the type annotations for ~hypothesis.strategies.tuples and ~hypothesis.strategies.one_of so that type-checkers require its argument
This patch updates the type annotations for ~hypothesis.strategies.tuples and ~hypothesis.strategies.one_of so that type-checkers require its arguments to be positional-only, and so that it no longer fails under pyright-strict mode (see 3348). Additional changes are made to Hypothesis' internals improve pyright scans.
This patch by Cheuk Ting Ho adds support for 655 Required and NotRequired as attributes of ~python:typing.TypedDict in ~hypothesis.strategies.from_typ
This patch by Cheuk Ting Ho adds support for 655 Required and NotRequired as attributes of ~python:typing.TypedDict in ~hypothesis.strategies.from_type (3339).
This patch by Cheuk Ting Ho adds support for PEP 655 Required and NotRequired as attributes of TypedDict in from_type() ( issue #3339 ).
This patch fixes ~hypothesis.extra.numpy.from_dtype with long-precision floating-point datatypes (typecode g; see numpy:numpy.typename).
This patch fixes ~hypothesis.extra.numpy.from_dtype with long-precision floating-point datatypes (typecode g; see numpy:numpy.typename).
This patch fixes from_dtype() with long-precision floating-point datatypes (typecode g ; see numpy.typename() ).
This patch improves some error messages for custom signatures containing invalid parameter names (3317).
This patch improves some error messages for custom signatures containing invalid parameter names (3317).
This patch by Cheuk Ting Ho makes it an explicit error to call ~hypothesis.strategies.from_type or ~hypothesis.strategies.register_type_strategy with
This patch by Cheuk Ting Ho makes it an explicit error to call ~hypothesis.strategies.from_type or ~hypothesis.strategies.register_type_strategy with types that have no runtime instances (3280).
This patch by Cheuk Ting Ho makes it an explicit error to call from_type() or register_type_strategy() with types that have no runtime instances ( issue #3280 ).
This patch fixes silently dropping examples when the @example decorator is applied to itself (3319). This was always a weird pattern, but now it works
This patch fixes silently dropping examples when the @example decorator is applied to itself (3319). This was always a weird pattern, but now it works. Thanks to Ray Sogata, Keeri Tramm, and Kevin Khuong for working on this patch!
This patch fixes a rare bug where we could incorrectly treat ~python:inspect.Parameter.empty as a type annotation, if the callable had an explicitly a
This patch fixes a rare bug where we could incorrectly treat ~python:inspect.Parameter.empty as a type annotation, if the callable had an explicitly assigned __signature__.
This release adds an allow_nil argument to ~hypothesis.strategies.uuids, which you can use to... generate the nil UUID. Thanks to Shlok Gandhi for the
This release adds an allow_nil argument to ~hypothesis.strategies.uuids, which you can use to... generate the nil UUID. Thanks to Shlok Gandhi for the patch!
This patch fixes some missing imports for certain Ghostwritten tests. Thanks to Mel Seto for fixing 3316.
This patch fixes some missing imports for certain Ghostwritten tests. Thanks to Mel Seto for fixing 3316.
This patch teaches the Ghostwriter to recognize many more common argument names (3311).
This patch teaches the Ghostwriter to recognize many more common argument names (3311).
This patch fixes 3314, where Hypothesis would raise an internal error from ~hypothesis.provisional.domains or (only on Windows) from ~hypothesis.strat
This patch fixes 3314, where Hypothesis would raise an internal error from ~hypothesis.provisional.domains or (only on Windows) from ~hypothesis.strategies.timezones in some rare circumstances where the installation was subtly broken.
Thanks to Munir Abdinur for this contribution.
This patch fixes issue #3314 , where Hypothesis would raise an internal error from domains() or (only on Windows) from timezones() in some rare circumstances where the installation was subtly broken.
Thanks to Munir Abdinur for this contribution.
This release fixes deprecation warnings about sre_compile and sre_parse imports and importlib.resources usage when running Hypothesis on Python 3.11.
This release fixes deprecation warnings about sre_compile and sre_parse imports and importlib.resources usage when running Hypothesis on Python 3.11.
Thanks to Florian Bruhin for this contribution.
This release updates xps.indices by introducing an allow_newaxis argument, defaulting to False. If allow_newaxis=True, indices can be generated that a
This release updates xps.indices by introducing an allow_newaxis argument, defaulting to False. If allow_newaxis=True, indices can be generated that add dimensions to arrays, which is achieved by the indexer containing None. This change is to support a specification change that expand dimensions via indexing (data-apis/array-api#408).
This release adds a names argument to ~hypothesis.extra.pandas.indexes and ~hypothesis.extra.pandas.series, so that you can create Pandas objects with
This release adds a names argument to ~hypothesis.extra.pandas.indexes and ~hypothesis.extra.pandas.series, so that you can create Pandas objects with specific or varied names.
Contributed by Sam Watts.
This release adds a names argument to indexes() and series() , so that you can create Pandas objects with specific or varied names.
Contributed by Sam Watts.
This patch updates the type annotations for @given so that type-checkers will warn on mixed positional and keyword arguments, as well as fixing 3296.
This patch updates the type annotations for @given so that type-checkers will warn on mixed positional and keyword arguments, as well as fixing 3296.
Fixed a type annotation for pyright --strict (3287).
Fixed a type annotation for pyright --strict (3287).
This patch makes it an explicit error to call ~hypothesis.strategies.register_type_strategy with a Pydantic GenericModel __ and a callable, because Ge
This patch makes it an explicit error to call ~hypothesis.strategies.register_type_strategy with a Pydantic GenericModel and a callable, because GenericModel isn't actually a generic type at runtime and so you have to register each of the "parametrized versions" (actually subclasses!) manually. See 2940 for more details.
This release makes it an explicit error to apply @pytest.fixture to a function which has already been decorated with @given() . Previously, pytest wou
This release makes it an explicit error to apply @pytest.fixture to a function which has already been decorated with @given(). Previously, pytest would convert your test to a fixture, and then never run it.
This patch fixes ~hypothesis.strategies.from_type on a ~python:typing.TypedDict with complex annotations, defined in a file using from __future__ impo
This patch fixes ~hypothesis.strategies.from_type on a ~python:typing.TypedDict with complex annotations, defined in a file using from __future__ import annotations. Thanks to Katelyn Gigante for identifying and fixing this bug!
This patch fixes from_type() on a TypedDict with complex annotations, defined in a file using from future import annotations . Thanks to Katelyn Gigante for identifying and fixing this bug!
The Hypothesis pytest plugin was not outputting valid xunit2 nodes when --junit-xml was specified. This has been broken since Pytest 5.4, which change
The Hypothesis pytest plugin was not outputting valid xunit2 nodes when --junit-xml was specified. This has been broken since Pytest 5.4, which changed the internal API for adding nodes to the junit report.
This also fixes the issue when using hypothesis with --junit-xml and pytest-xdist where the junit xml report would not be xunit2 compatible. Now, when using with pytest-xdist, the junit report will just omit the <properties> node.
For more details, see this pytest issue, this pytest issue, and 1935.
Thanks to Brandon Chinn for this bug fix!
This patch fixes pretty-printing of regular expressions in Python 3.11.0a7, and updates our vendored list of top-level domains __,.
This patch fixes pretty-printing of regular expressions in Python 3.11.0a7, and updates our vendored list of top-level domains,.
This release makes st.functions(pure=True) less noisy (3253), and generally improves pretty-printing of functions.
This release makes st.functions(pure=True) less noisy (3253), and generally improves pretty-printing of functions.
This release changes the implementation of ~hypothesis.infer to be an alias for python:Ellipsis. E.g. @given(a=infer) is now equivalent to @given(a=..
This release changes the implementation of ~hypothesis.infer to be an alias for python:Ellipsis. E.g. @given(a=infer) is now equivalent to @given(a=...). Furthermore, @given(...) can now be specified so that @given will infer the strategies for all arguments of the decorated function based on its annotations.
This patch simplifies the repr of the strategies namespace returned in ~hypothesis.extra.array_api.make_strategies_namespace, e.g.
This patch simplifies the repr of the strategies namespace returned in ~hypothesis.extra.array_api.make_strategies_namespace, e.g.
>>> from hypothesis.extra.array_api import make_strategies_namespace
>>> from numpy import array_api as xp
>>> xps = make_strategies_namespace(xp)
>>> xps
make_strategies_namespace(numpy.array_api)
This patch simplifies the repr of the strategies namespace returned in make_strategies_namespace() , e.g.
from hypothesis.extra.array_api import make_strategies_namespace >>> from numpy import array_api as xp >>> xps = make_strategies_namespace ( xp ) >>> xps make_strategies_namespace(numpy.array_api)
One column per quarter.