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 6 days ago
28 Sep 2026
Ships on a steady schedule
a new release about every 9 days
Nearly every release is documented
notes for 60 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
14 years old
1571 releases · first in 2013
This release 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.
One column per quarter.
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)
Fixed ~hypothesis.strategies.from_type support for 604 union types, like int | None (3255).
Fixed ~hypothesis.strategies.from_type support for 604 union types, like int | None (3255).
Fixed from_type() support for PEP 604 union types, like int | None ( issue #3255 ).
Fixed an internal error when ~hypothesis.given was passed a lambda.
Fixed an internal error when ~hypothesis.given was passed a lambda.
The Ghostwriter can now write tests which check that two or more functions are equivalent on valid inputs, *or* raise the same type of exception for i
The Ghostwriter can now write tests which check that two or more functions are equivalent on valid inputs, or raise the same type of exception for invalid inputs (3267).
This patch makes some quality-of-life improvements to the Ghostwriter : we guess the ~hypothesis.strategies.text strategy for arguments named text (..
This patch makes some quality-of-life improvements to the Ghostwriter: we guess the ~hypothesis.strategies.text strategy for arguments named text (...obvious in hindsight, eh?); and improved the error message if you accidentally left in a ~hypothesis.strategies.nothing or broke your rich install.
This patch makes some quality-of-life improvements to the Ghostwriter : we guess the text() strategy for arguments named text (…obvious in hindsight, eh?); and improved the error message if you accidentally left in a nothing() or broke your rich install.
This patch improves our error detection and message when Hypothesis is run on a Python implementation without support for -0.0, which is required for
This patch improves our error detection and message when Hypothesis is run on a Python implementation without support for -0.0, which is required for the ~hypothesis.strategies.floats strategy but can be disabled by unsafe compiler options (3265).
This patch tweaks some internal formatting. There is no user-visible change.
This patch tweaks some internal formatting. There is no user-visible change.
If the ~hypothesis.Phase.shrink phase is disabled, we now stop the ~hypothesis.Phase.generate phase as soon as an error is found regardless of the val
If the ~hypothesis.Phase.shrink phase is disabled, we now stop the ~hypothesis.Phase.generate phase as soon as an error is found regardless of the value of the report_multiple_examples setting, since that's probably what you wanted (3244).
If the shrink phase is disabled, we now stop the generate phase as soon as an error is found regardless of the value of the report_multiple_examples setting, since that’s probably what you wanted ( issue #3244 ).
This patch clarifies rare error messages in ~hypothesis.strategies.builds (3225) and ~hypothesis.strategies.floats (3207).
This patch clarifies rare error messages in ~hypothesis.strategies.builds (3225) and ~hypothesis.strategies.floats (3207).
This patch clarifies rare error messages in builds() ( issue #3225 ) and floats() ( issue #3207 ).
This patch fixes a regression where the bound inner function (your_test.hypothesis.inner_test) would be invoked with positional arguments rather than
This patch fixes a regression where the bound inner function (your_test.hypothesis.inner_test) would be invoked with positional arguments rather than passing them by name, which broke pytest-asyncio (3245).
This release improves Hypothesis' handling of positional-only arguments, which are now allowed @st.composite strategies.
This release improves Hypothesis' handling of positional-only arguments, which are now allowed @st.composite strategies.
On Python 3.8 and later, the first arguments to ~hypothesis.strategies.builds and ~hypothesis.extra.django.from_model are now natively positional-only. In cases which were already errors, the TypeError from incorrect usage will therefore be raises immediately when the function is called, rather than when the strategy object is used.
This release makes ~hypothesis.strategies.floats error *consistently* when your floating-point hardware has been configured to violate IEEE-754 for su
This release makes ~hypothesis.strategies.floats error consistently when your floating-point hardware has been configured to violate IEEE-754 for subnormal numbers, instead of only when an internal assertion was tripped (3092).
If this happens to you, passing allow_subnormal=False will suppress the explicit error. However, we strongly recommend fixing the root cause by disabling global-effect unsafe-math compiler options instead, or at least consulting e.g. Simon Byrne's Beware of fast-math explainer first.
This patch fixes a bug in stateful testing, where returning a single value wrapped in ~hypothesis.stateful.multiple would be printed such that the ass
This patch fixes a bug in stateful testing, where returning a single value wrapped in ~hypothesis.stateful.multiple would be printed such that the assigned variable was a tuple rather than the single element (3236).
This patch fixes a warning under pytest 7 relating to our rich traceback display logic (3223).
This patch fixes a warning under pytest 7 relating to our rich traceback display logic (3223).
When distinguishing multiple errors, Hypothesis now looks at the inner exceptions of 654 ExceptionGroup\ s.
When distinguishing multiple errors, Hypothesis now looks at the inner exceptions of 654 ExceptionGroups.
When distinguishing multiple errors, Hypothesis now looks at the inner exceptions of PEP 654 ExceptionGroup s.
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 fixes some deprecation warnings from pytest 7.0, along with some code formatting and docs updates.
This patch fixes some deprecation warnings from pytest 7.0, along with some code formatting and docs updates.
This release disallows using python:typing.Final with ~hypothesis.strategies.from_type and ~hypothesis.strategies.register_type_strategy.
This release disallows using python:typing.Final with ~hypothesis.strategies.from_type and ~hypothesis.strategies.register_type_strategy.
Why? Because Final can only be used during class definition. We don't generate class attributes.
It also does not make sense as a runtime type on its own.
This release disallows using typing.Final with from_type() and register_type_strategy() .
Why? Because Final can only be used during class definition. We don’t generate class attributes.
It also does not make sense as a runtime type on its own.
This patch fixes hypothesis write output highlighting with rich version 12.0 and later.
This patch fixes hypothesis write output highlighting with rich version 12.0 and later.
This release disallows using python:typing.ClassVar with ~hypothesis.strategies.from_type and ~hypothesis.strategies.register_type_strategy.
This release disallows using python:typing.ClassVar with ~hypothesis.strategies.from_type and ~hypothesis.strategies.register_type_strategy.
Why? Because ClassVar can only be used during class definition. We don't generate class attributes.
It also does not make sense as a runtime type on its own.
This release disallows using typing.ClassVar with from_type() and register_type_strategy() .
Why? Because ClassVar can only be used during class definition. We don’t generate class attributes.
It also does not make sense as a runtime type on its own.
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 fixes 3169, an extremely rare bug which would trigger if an internal least-recently-reused cache dropped a newly added entry immediately af
This patch fixes 3169, an extremely rare bug which would trigger if an internal least-recently-reused cache dropped a newly added entry immediately after it was added.
This release fixes 3133 and 3144, where attempting to generate Pandas series of lists or sets would fail with confusing errors if you did not specify
This release fixes 3133 and 3144, where attempting to generate Pandas series of lists or sets would fail with confusing errors if you did not specify dtype=object.
This release disallows using python:typing.TypeAlias with ~hypothesis.strategies.from_type and ~hypothesis.strategies.register_type_strategy.
This release disallows using python:typing.TypeAlias with ~hypothesis.strategies.from_type and ~hypothesis.strategies.register_type_strategy.
Why? Because TypeAlias is not really a type, it is a tag for type checkers that some expression is a type alias, not something else.
It does not make sense for Hypothesis to resolve it as a strategy. References 2978.
This release disallows using typing.TypeAlias with from_type() and register_type_strategy() .
Why? Because TypeAlias is not really a type, it is a tag for type checkers that some expression is a type alias, not something else.
It does not make sense for Hypothesis to resolve it as a strategy. References issue #2978 .
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 release drops support for Python 3.6, which reached end of life upstream __ on 2021-12-23.
This release drops support for Python 3.6, which reached end of life upstream on 2021-12-23.
Your coding agent can read these notes before it upgrades. Set up the MCP server →