NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #539 most downloaded on PyPI
The property-based testing library for Python
Last release 5 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 adds ~hypothesis.database.GitHubArtifactDatabase, a new database backend that allows developers to access the examples found by a Github
This release adds ~hypothesis.database.GitHubArtifactDatabase, a new database backend that allows developers to access the examples found by a Github Actions CI job. This is particularly useful for workflows that involve continuous fuzzing, like HypoFuzz.
Thanks to Agustín Covarrubias for this feature!
This patch clarifies the reporting of time spent generating data. A simple arithmetic mean of the percentage of time spent can be misleading; reportin
This patch clarifies the reporting of time spent generating data. A simple arithmetic mean of the percentage of time spent can be misleading; reporting the actual time spent avoids misunderstandings.
Thanks to Andrea Reina for reporting and fixing 3598!
One column per quarter.
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 optional domains= parameter to the ~hypothesis.strategies.emails strategy, and excludes the special-use .arpa domain from the def
This release adds an optional domains= parameter to the ~hypothesis.strategies.emails strategy, and excludes the special-use .arpa domain from the default strategy (3567).
Thanks to Jens Tröger for reporting and fixing this bug!
Passing them to suppress_health_check= is therefore a deprecated no-op. (3568). Thanks to Reagan Lee for the patch!
This release turns HealthCheck.return_value and HealthCheck.not_a_test_method into unconditional errors. Passing them to suppress_health_check= is therefore a deprecated no-op. (3568). Thanks to Reagan Lee for the patch!
Separately, GraalPy can now run and pass most of the hypothesis test suite (3587).
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 missing imports of the re module, when ghostwriting tests which include compiled patterns or regex flags. Thanks to Jens Heinrich for
This patch fixes missing imports of the re module, when ghostwriting tests which include compiled patterns or regex flags. Thanks to Jens Heinrich for reporting and promptly fixing this bug!
This patch adds some private hooks for use in research on Schemathesis __ (see our preprint here __).
This patch adds some private hooks for use in research on Schemathesis (see our preprint here).
Additionally this release now treats hypothesis.extra.array_api as stable, meaning breaking changes should only happen with major releases of Hypothes…
This release adds support for the Array API's 2022.12 release via the api_version argument in ~hypothesis.extra.array_api.make_strategies_namespace. Concretely this involves complex support in its existing strategies, plus an introduced xps.complex_dtypes strategy.
Additionally this release now treats hypothesis.extra.array_api as stable, meaning breaking changes should only happen with major releases of Hypothesis.
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 allows for more precise generation of complex numbers using ~hypothesis.extra.numpy.from_dtype, by supporting the width, min_magnitude, a
This release allows for more precise generation of complex numbers using ~hypothesis.extra.numpy.from_dtype, by supporting the width, min_magnitude, and min_magnitude arguments (3468).
Thanks to Felix Divo for this feature!
This patch fixes a rare RecursionError when pretty-printing a multi-line object without type-specific printer, which was passed to a function which re
This patch fixes a rare RecursionError when pretty-printing a multi-line object without type-specific printer, which was passed to a function which returned the same object by .map() or ~hypothesis.strategies.builds and thus recursed due to the new pretty reprs in Hypothesis v6.65.0 (3560). Apologies to all those affected.
This patch fixes a rare RecursionError when pretty-printing a multi-line object without type-specific printer, which was passed to a function which returned the same object by .map() or builds() and thus recursed due to the new pretty reprs in Hypothesis 6.65.0 - 2023-01-24 ( issue #3560 ). Apologies to all those affected.
This makes ~hypothesis.extra.numpy.from_dtype pass through the parameter allow_subnormal for complex dtypes.
This makes ~hypothesis.extra.numpy.from_dtype pass through the parameter allow_subnormal for complex dtypes.
This makes from_dtype() pass through the parameter allow_subnormal for complex dtypes.
This release adds a width parameter to ~hypothesis.strategies.complex_numbers, analogously to ~hypothesis.strategies.floats.
This release adds a width parameter to ~hypothesis.strategies.complex_numbers, analogously to ~hypothesis.strategies.floats.
Thanks to Felix Divo for the new feature!
This release adds a width parameter to complex_numbers() , analogously to floats() .
Thanks to Felix Divo for the new feature!
This patch fixes invalid annotations detected for the tests generated by Ghostwriter . It will now correctly generate Optional types with just one typ
This patch fixes invalid annotations detected for the tests generated by Ghostwriter. It will now correctly generate Optional types with just one type argument and handle union expressions inside of type arguments correctly. Additionally, it now supports code with the from __future__ import annotations marker for Python 3.10 and newer.
This release improves the pretty-printing of enums in falsifying examples, so that they print as their full identifier rather than their repr.
This release improves the pretty-printing of enums in falsifying examples, so that they print as their full identifier rather than their repr.
Hypothesis now reports some failing inputs by showing the call which constructed an object, rather than the repr of the object. This can be helpful wh
Hypothesis now reports some failing inputs by showing the call which constructed an object, rather than the repr of the object. This can be helpful when the default repr does not include all relevant details, and will unlock further improvements in a future version.
For now, we capture calls made via ~hypothesis.strategies.builds, and via |.map|.
The Ghostwriter will now include type annotations on tests for type-annotated code. If you want to force this to happen (or not happen), pass a boolea
The Ghostwriter will now include type annotations on tests for type-annotated code. If you want to force this to happen (or not happen), pass a boolean to the new annotate= argument to the Python functions, or the --[no-]annotate CLI flag.
Thanks to Nicolas Ganz for this new feature!
~hypothesis.extra.pandas.range_indexes now accepts a name= argument, to generate named pandas.RangeIndex objects.
~hypothesis.extra.pandas.range_indexes now accepts a name= argument, to generate named pandas.RangeIndex objects.
Thanks to Sam Watts for this new feature!
This patch tweaks xps.arrays internals to improve PyTorch compatibility. Specifically, torch.full() does not accept integers as the shape argument (n.
This patch tweaks xps.arrays internals to improve PyTorch compatibility. Specifically, torch.full() does not accept integers as the shape argument (n.b. technically "size" in torch), but such behaviour is expected in internal code, so we copy the torch module and patch in a working full() function.
A classic error when testing is to write a test function that can never fail, even on inputs that aren't allowed or manually provided. By analogy to t
A classic error when testing is to write a test function that can never fail, even on inputs that aren't allowed or manually provided. By analogy to the design pattern of:
@pytest.mark.parametrize("arg", [
..., # passing examples
pytest.param(..., marks=[pytest.mark.xfail]) # expected-failing input
])
we now support @example(...).xfail(), with the same (optional) condition, reason, and raises arguments as pytest.mark.xfail().
Naturally you can also write .via(...).xfail(...), or .xfail(...).via(...), if you wish to note the provenance of expected-failing examples.
This patch teaches our enhanced ~typing.get_type_hints function to 'see through' ~functools.partial application, allowing inference from type hints to
This patch teaches our enhanced ~typing.get_type_hints function to 'see through' ~functools.partial application, allowing inference from type hints to work in a few more cases which aren't (yet!) supported by the standard-library version.
This patch teaches our enhanced get_type_hints() function to ‘see through’ partial application, allowing inference from type hints to work in a few more cases which aren’t (yet!) supported by the standard-library version.
This patch improves our pretty-printing of failing examples, including some refactoring to prepare for exciting future features.
This patch improves our pretty-printing of failing examples, including some refactoring to prepare for exciting future features.
This patch brings our ~hypothesis.provisional.domains and ~hypothesis.strategies.emails strategies into compliance with RFC RFC 5890 §2.3.1 <5890>: we
This patch brings our ~hypothesis.provisional.domains and ~hypothesis.strategies.emails strategies into compliance with RFC 5890 §2.3.1: we no longer generate parts-of-domains where the third and fourth characters are -- ("R-LDH labels"), though future versions may deliberately generate xn-- punycode labels. Thanks to python-email-validator for the report!
This release improves our treatment of database keys, which based on (among other things) the source code of your test function. We now post-process t
This release improves our treatment of database keys, which based on (among other things) the source code of your test function. We now post-process this source to ignore decorators, comments, trailing whitespace, and blank lines - so that you can add @example()s or make some small no-op edits to your code without preventing replay of any known failing or covering examples.
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 improves Hypothesis' ability to resolve forward references in type annotations. It fixes a bug that prevented ~hypothesis.strategies.buil
This release improves Hypothesis' ability to resolve forward references in type annotations. It fixes a bug that prevented ~hypothesis.strategies.builds from being used with pydantic models that possess updated forward references. See 3519.
The @example(...) decorator now has a .via() method, which future tools will use to track automatically-added covering examples (3506).
The @example(...) decorator now has a .via() method, which future tools will use to track automatically-added covering examples (3506).
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 shifts hypothesis[lark] from depending on the old lark-parser package to the new lark package. There are no code changes in Hypothesis, it'
This patch shifts hypothesis[lark] from depending on the old lark-parser package to the new lark package. There are no code changes in Hypothesis, it's just that Lark got a new name on PyPI for version 1.0 onwards.
~hypothesis.register_random has used weakref since v6.27.1, allowing the ~random.Random-compatible objects to be garbage-collected when there are no o
~hypothesis.register_random has used weakref since v6.27.1, allowing the ~random.Random-compatible objects to be garbage-collected when there are no other references remaining in order to avoid memory leaks. We now raise an error or emit a warning when this seems likely to happen immediately.
The type annotation of ~hypothesis.register_random was also widened so that structural subtypes of ~random.Random are accepted by static typecheckers.
register_random() has used weakref since 6.27.1 - 2021-11-22 , allowing the Random -compatible objects to be garbage-collected when there are no other references remaining in order to avoid memory leaks. We now raise an error or emit a warning when this seems likely to happen immediately.
The type annotation of register_random() was also widened so that structural subtypes of Random are accepted by static typecheckers.
This patch updates some internal type annotations and fixes a formatting bug in the ~hypothesis.Phase.explain phase reporting.
This patch updates some internal type annotations and fixes a formatting bug in the ~hypothesis.Phase.explain phase reporting.
This patch updates some internal type annotations and fixes a formatting bug in the explain phase reporting.
Hypothesis now raises an error if you passed a strategy as the alphabet= argument to ~hypothesis.strategies.text, and it generated something which was
Hypothesis now raises an error if you passed a strategy as the alphabet= argument to ~hypothesis.strategies.text, and it generated something which was not a length-one string. This has never been supported, we're just adding explicit validation to catch cases like this StackOverflow question.
This patch updates some docs, and depends on exceptiongroup 1.0.0 final to avoid a bug in the previous version.
This patch updates some docs, and depends on exceptiongroup 1.0.0 final to avoid a bug in the previous version.
This patch teaches ~hypothesis.strategies.text to rewrite a few more filter predicates (3134). You're unlikely to notice any change.
This patch teaches ~hypothesis.strategies.text to rewrite a few more filter predicates (3134). You're unlikely to notice any change.
This patch teaches text() to rewrite a few more filter predicates ( issue #3134 ). You’re unlikely to notice any change.
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.
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.
Your coding agent can read these notes before it upgrades. Set up the MCP server →