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.
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.
Your coding agent can read these notes before it upgrades. Set up the MCP server →
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.
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.
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.
One column per quarter.