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 2 days ago
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.
Hypothesis has adopted black as our code formatter (1686). There are no functional changes to the source, but it's prettier!
Hypothesis has adopted black as our code formatter (1686). There are no functional changes to the source, but it's prettier!
This patch increases the variety of examples generated by ~hypothesis.strategies.from_type.
This patch increases the variety of examples generated by ~hypothesis.strategies.from_type.
This patch increases the variety of examples generated by from_type() .
Your coding agent can read these notes before it upgrades. Set up the MCP server →
Our pytest plugin now warns you when strategy functions have been collected as tests, which may happen when e.g. using the @composite decorator when y
Our pytest plugin now warns you when strategy functions have been collected as tests, which may happen when e.g. using the @composite decorator when you should be using @given(st.data()) for inline draws. Such functions always pass when treated as tests, because the lazy creation of strategies mean that the function body is never actually executed!
Hypothesis can now show statistics when running under pytest-xdist. Previously, statistics were only reported when all tests were run in a single proc
Hypothesis can now show statistics when running under pytest-xdist. Previously, statistics were only reported when all tests were run in a single process (700).
This patch fixes 1667, where passing bounds of Numpy dtype int64 to ~hypothesis.strategies.integers could cause errors on Python 3 due to internal rou
This patch fixes 1667, where passing bounds of Numpy dtype int64 to ~hypothesis.strategies.integers could cause errors on Python 3 due to internal rounding.
Hypothesis now seeds and resets the global state of np.random for each test case, to ensure that tests are reproducible.
Hypothesis now seeds and resets the global state of np.random for each test case, to ensure that tests are reproducible.
This matches and complements the existing handling of the python:random module - Numpy simply maintains an independent PRNG for performance reasons.
This is a no-op release to add the new Framework :: Hypothesis trove classifier _ to hypothesis on PyPI.
This is a no-op release to add the new Framework :: Hypothesis trove classifier to hypothesis on PyPI.
You can use it as a filter to find Hypothesis-related packages such as extensions as they add the tag over the coming weeks, or simply visit our curated list.
The Hypothesis for Pandas extension is now listed in setup.py, so you can pip install hypothesis[pandas]. Thanks to jmshi for this contribution.
The Hypothesis for Pandas extension is now listed in setup.py, so you can pip install hypothesis[pandas]. Thanks to jmshi for this contribution.
This patch fixes ~hypothesis.strategies.from_type on Python 2 for classes where cls.__init__ is object.__init__. Thanks to ccxcz for reporting 1656.
This patch fixes ~hypothesis.strategies.from_type on Python 2 for classes where cls.__init__ is object.__init__. Thanks to ccxcz for reporting 1656.
…within the function. Passing None is therefore deprecated.
The alphabet argument for ~hypothesis.strategies.text now uses its default value of characters(exclude_categories=('Cs',)) directly, instead of hiding that behind alphabet=None and replacing it within the function. Passing None is therefore deprecated.
GenericStateMachine and ~hypothesis.stateful.RuleBasedStateMachine now raise an explicit error when instances of ~hypothesis.settings are assigned to
GenericStateMachine and ~hypothesis.stateful.RuleBasedStateMachine now raise an explicit error when instances of ~hypothesis.settings are assigned to the classes' settings attribute, which is a no-op (1643). Instead assign to SomeStateMachine.TestCase.settings, or use @settings(...) as a class decorator to handle this automatically.
GenericStateMachine and RuleBasedStateMachine now raise an explicit error when instances of settings are assigned to the classes’ settings attribute, which is a no-op ( issue #1643 ). Instead assign to SomeStateMachine.TestCase.settings , or use @settings(...) as a class decorator to handle this automatically.
Since version 3.68.0 , ~hypothesis.extra.numpy.arrays checks that values drawn from the elements and fill strategies can be safely cast to the dtype o
Since version 3.68.0, ~hypothesis.extra.numpy.arrays checks that values drawn from the elements and fill strategies can be safely cast to the dtype of the array, and emits a warning otherwise.
This release expands the checks to cover overflow for finite complex64 elements and string truncation caused by too-long elements or trailing null characters (1591).
Tests using @given now shrink errors raised from pytest helper functions, instead of reporting the first example found.
Tests using @given now shrink errors raised from pytest helper functions, instead of reporting the first example found.
This was previously fixed in version 3.56.0, but only for stateful testing.
Traceback elision is now disabled on Python 2, to avoid an import-time python:SyntaxError under Python < 2.7.9 (Python: 21591, Hypothesis 3.79.2 : 164
Traceback elision is now disabled on Python 2, to avoid an import-time python:SyntaxError under Python < 2.7.9 (Python: 21591, Hypothesis 3.79.2: 1648).
We encourage all users to upgrade to Python 3 before the end of 2019.
Traceback elision is now disabled on Python 2, to avoid an import-time SyntaxError under Python < 2.7.9 (Python: bpo-21591 , Hypothesis 3.79.2 : issue #1648 ).
We encourage all users to upgrade to Python 3 before the end of 2019 .
This patch shortens tracebacks from Hypothesis, so you can see exactly happened in your code without having to skip over irrelevant details about our
This patch shortens tracebacks from Hypothesis, so you can see exactly happened in your code without having to skip over irrelevant details about our internals (848).
In the example test (see 1582), this reduces tracebacks from nine frames to just three - and for a test with multiple errors, from seven frames per error to just one!
If you do want to see the internal details, you can disable frame elision by setting ~hypothesis.settings.verbosity to debug.
The abstract number classes ~python:numbers.Number, ~python:numbers.Complex, ~python:numbers.Real, ~python:numbers.Rational, and ~python:numbers.Integ
The abstract number classes ~python:numbers.Number, ~python:numbers.Complex, ~python:numbers.Real, ~python:numbers.Rational, and ~python:numbers.Integral are now supported by the ~hypothesis.strategies.from_type strategy. Previously, you would have to use ~hypothesis.strategies.register_type_strategy before they could be resolved (1636)
The abstract number classes Number , Complex , Real , Rational , and Integral are now supported by the from_type() strategy. Previously, you would have to use register_type_strategy() before they could be resolved ( issue #1636 )
This release adds a CLI flag for verbosity --hypothesis-verbosity to the Hypothesis pytest plugin, applied after loading the profile specified by --hy
This release adds a CLI flag for verbosity --hypothesis-verbosity to the Hypothesis pytest plugin, applied after loading the profile specified by --hypothesis-profile. Valid options are the names of verbosity settings, quiet, normal, verbose or debug.
Thanks to Bex Dunn for writing this patch at the PyCon Australia sprints!
The pytest header now correctly reports the current profile if --hypothesis-profile has been used.
Thanks to Mathieu Paturel for the contribution at the Canberra Python Hacktoberfest.
This release has deprecated the generation of integers, floats and fractions when the conversion of the upper and/ or lower bound is not 100% exact, e…
This release has deprecated the generation of integers, floats and fractions when the conversion of the upper and/ or lower bound is not 100% exact, e.g. when an integer gets passed a bound that is not a whole number. (1625)
Thanks to Felix Grünewald for this patch during Hacktoberfest 2018.
This minor release adds functionality to ~hypothesis.settings allowing it to be used as a decorator on ~hypothesis.stateful.RuleBasedStateMachine and
This minor release adds functionality to ~hypothesis.settings allowing it to be used as a decorator on ~hypothesis.stateful.RuleBasedStateMachine and GenericStateMachine.
Thanks to Tyler Nickerson for this feature in #hacktoberfest!
This minor release adds functionality to settings allowing it to be used as a decorator on RuleBasedStateMachine and GenericStateMachine .
Thanks to Tyler Nickerson for this feature in #hacktoberfest!
This patch fixes some warnings added by recent releases of pydocstyle and mypy.
This patch fixes some warnings added by recent releases of pydocstyle and mypy.
This release deprecates using floats for min_size and max_size.
This release deprecates using floats for min_size and max_size.
The type hint for average_size arguments has been changed from Optional[int] to None, because non-None values are always ignored and deprecated.
This patch adds more internal comments to the core engine's sequence-length shrinker. There should be no user-visible change.
This patch adds more internal comments to the core engine's sequence-length shrinker. There should be no user-visible change.
This patch adds additional comments to some of the core engine's internal data structures. There is no user-visible change.
This patch adds additional comments to some of the core engine's internal data structures. There is no user-visible change.
This patch avoids caching a trivial case, fixing 493.
This patch avoids caching a trivial case, fixing 493.
This patch fixes a broken link in a docstring. Thanks to Benjamin Lee for this contribution!
This patch fixes a broken link in a docstring. Thanks to Benjamin Lee for this contribution!
This release deprecates the use of min_size=None, setting the default min_size to 0 (1618).
This release deprecates the use of min_size=None, setting the default min_size to 0 (1618).
This patch makes some small internal changes to comply with a new lint setting in the build. There should be no user-visible change.
This patch makes some small internal changes to comply with a new lint setting in the build. There should be no user-visible change.
This patch fixes 1153, where time spent reifying a strategy was also counted in the time spent generating the first example. Strategies are now fully
This patch fixes 1153, where time spent reifying a strategy was also counted in the time spent generating the first example. Strategies are now fully constructed and validated before the timer is started.
This patch fixes some broken formatting and links in the documentation.
This patch fixes some broken formatting and links in the documentation.
Being able to specify a boolean value was not intended, and is now deprecated. In addition, specifying True will now cause the blob to always be print…
This release checks that the value of the ~hypothesis.settings.print_blob setting is a PrintSettings instance.
Being able to specify a boolean value was not intended, and is now deprecated. In addition, specifying True will now cause the blob to always be printed, instead of causing it to be suppressed.
Specifying any value that is not a PrintSettings or a boolean is now an error.
…names min_value and max_value instead of the deprecated names
Changes the documentation for hypothesis.strategies.datetimes, hypothesis.strategies.dates, hypothesis.strategies.times to use the new parameter names min_value and max_value instead of the deprecated names
This patch ensures that Hypothesis deprecation warnings display the code that emitted them when you're not running in -Werror mode (652).
This patch ensures that Hypothesis deprecation warnings display the code that emitted them when you're not running in -Werror mode (652).
Tracebacks involving @composite are now slightly shorter due to some internal refactoring.
Tracebacks involving @composite are now slightly shorter due to some internal refactoring.
This patch fixes errors in the internal comments for one of the shrinker passes. There is no user-visible change.
This patch fixes errors in the internal comments for one of the shrinker passes. There is no user-visible change.
This patch substantially improves the distribution of data generated with ~hypothesis.strategies.recursive, and fixes a rare internal error (1502).
This patch substantially improves the distribution of data generated with ~hypothesis.strategies.recursive, and fixes a rare internal error (1502).
This patch substantially improves the distribution of data generated with recursive() , and fixes a rare internal error ( issue #1502 ).
This release adds the ~hypothesis.extra.dpcontracts.fulfill function, which is designed for testing code that uses dpcontracts 0.4 or later for input
This release adds the ~hypothesis.extra.dpcontracts.fulfill function, which is designed for testing code that uses dpcontracts 0.4 or later for input validation. This provides some syntactic sugar around use of ~hypothesis.assume, to automatically filter out and retry calls that cause a precondition check to fail (1474).
This release makes setting attributes of the hypothesis.settings class an explicit error. This has never had any effect, but could mislead users who c
This release makes setting attributes of the hypothesis.settings class an explicit error. This has never had any effect, but could mislead users who confused it with the current settings instance hypothesis.settings.default (which is also immutable). You can change the global settings with |settings.register_profile|.
This patch factors out some common code in the shrinker for iterating over pairs of data blocks. There should be no user-visible change.
This patch factors out some common code in the shrinker for iterating over pairs of data blocks. There should be no user-visible change.
This patch allows ~hypothesis.strategies.from_type to handle the empty tuple type, typing.Tuple[()] .
This patch allows ~hypothesis.strategies.from_type to handle the empty tuple type, typing.Tuple[()].
This patch allows from_type() to handle the empty tuple type, typing.Tuple[()] .
This patch updates some internal comments for mypy. There is no user-visible effect, even for Mypy users.
This patch updates some internal comments for mypy. There is no user-visible effect, even for Mypy users.
This patch fixes a rare bug that would cause a particular shrinker pass to raise an IndexError, if a shrink improvement changed the underlying data in
This patch fixes a rare bug that would cause a particular shrinker pass to raise an IndexError, if a shrink improvement changed the underlying data in an unexpected way.
This release fixes the broken cross-references in our docs, and adds a CI check so we don't add new ones.
This release fixes the broken cross-references in our docs, and adds a CI check so we don't add new ones.
This patch fixes two bugs (944 and 1521), where messages about @seed did not check the current verbosity setting, and the wrong settings were active w
This patch fixes two bugs (944 and 1521), where messages about @seed did not check the current verbosity setting, and the wrong settings were active while executing explicit examples from |@example|.
This patch fixes a DeprecationWarning added in Python 3.8 (1576).
This patch fixes a DeprecationWarning added in Python 3.8 (1576).
Thanks to tirkarthi for this contribution!
This is a no-op release, which implements automatic DOI minting and code archival of Hypothesis via Zenodo _. Thanks to CERN and the EU *Horizon 2020*
This is a no-op release, which implements automatic DOI minting and code archival of Hypothesis via Zenodo. Thanks to CERN and the EU Horizon 2020 programme for providing this service!
Check our CITATION.cff file for details, or head right on over to doi.org/10.5281/zenodo.1412597
This release adds the test name to some deprecation warnings, for easier debugging.
This release adds the test name to some deprecation warnings, for easier debugging.
Thanks to Sanyam Khurana for the patch!
This release makes Hypothesis's memory usage substantially smaller for tests with many examples, by bounding the number of past examples it keeps arou
This release makes Hypothesis's memory usage substantially smaller for tests with many examples, by bounding the number of past examples it keeps around.
You will not see much difference unless you are running tests with ~hypothesis.settings.max_examples set to well over 1000, but if you do have such tests then you should see memory usage mostly plateau where previously it would have grown linearly with time.
This patch adds internal comments to some tree traversals in the core engine. There is no user-visible change.
This patch adds internal comments to some tree traversals in the core engine. There is no user-visible change.
This release deprecates the coverage-guided testing functionality, as it has proven brittle and does not really pull its weight.
This release deprecates the coverage-guided testing functionality, as it has proven brittle and does not really pull its weight.
We intend to replace it with something more useful in the future, but the feature in its current form does not seem to be worth the cost of using, and whatever replaces it will likely look very different.
This patch changes the behaviour of ~hypothesis.reproduce_failure so that blobs are only printed in quiet mode when the ~hypothesis.settings.print_blo
This patch changes the behaviour of ~hypothesis.reproduce_failure so that blobs are only printed in quiet mode when the ~hypothesis.settings.print_blob setting is set to ALWAYS.
Thanks to Cameron McGill for writing this patch at the PyCon Australia sprints!
This patch changes the behaviour of reproduce_failure() so that blobs are only printed in quiet mode when the print_blob setting is set to ALWAYS .
Thanks to Cameron McGill for writing this patch at the PyCon Australia sprints!
This patch removes some unnecessary code from the internals. There is no user-visible change.
This patch removes some unnecessary code from the internals. There is no user-visible change.
This patch fixes an internal bug where a corrupted argument to @reproduce_failure could raise the wrong type of error. Thanks again to Paweł T. Jochym
This patch fixes an internal bug where a corrupted argument to @reproduce_failure could raise the wrong type of error. Thanks again to Paweł T. Jochym, who maintains Hypothesis on conda-forge and consistently provides excellent bug reports including 1558.
This patch updates hypothesis to report its version and settings when run with pytest. (1223).
This patch updates hypothesis to report its version and settings when run with pytest. (1223).
Thanks to Jack Massey for this feature.
This release adds a fullmatch argument to ~hypothesis.strategies.from_regex. When fullmatch=True, the whole example will match the regex pattern as fo
This release adds a fullmatch argument to ~hypothesis.strategies.from_regex. When fullmatch=True, the whole example will match the regex pattern as for python:re.fullmatch.
Thanks to Jakub Nabaglo for writing this patch at the PyCon Australia sprints!
This release adds a fullmatch argument to from_regex() . When fullmatch=True , the whole example will match the regex pattern as for re.fullmatch() .
Thanks to Jakub Nabaglo for writing this patch at the PyCon Australia sprints!
This release reverts the changes to logging handling in 3.69.11, which broke test that use the pytest caplog fixture internally because all logging wa
This release reverts the changes to logging handling in 3.69.11, which broke test that use the pytest caplog fixture internally because all logging was disabled (1546).
This patch will hide all logging messages produced by test cases before the final, minimal, failing test case (356).
This patch will hide all logging messages produced by test cases before the final, minimal, failing test case (356).
Thanks to Gary Donovan for writing this patch at the PyCon Australia sprints!
This patch fixes a bug that prevents coverage from reporting unexecuted Python files (1085).
This patch fixes a bug that prevents coverage from reporting unexecuted Python files (1085).
Thanks to Gary Donovan for writing this patch at the PyCon Australia sprints!
This patch improves the packaging of the Python package by adding LICENSE.txt to the sdist (1311), clarifying the minimum supported versions of pytz a
This patch improves the packaging of the Python package by adding LICENSE.txt to the sdist (1311), clarifying the minimum supported versions of pytz and dateutil (1383), and adds keywords to the metadata (1520).
Thanks to Graham Williamson for writing this patch at the PyCon Australia sprints!
This is an internal change which replaces pickle with json to prevent possible security issues.
This is an internal change which replaces pickle with json to prevent possible security issues.
Thanks to Vidya Rani D G for writing this patch at the PyCon Australia sprints!
This patch ensures that ~hypothesis.note prints the note for every test case when the ~hypothesis.settings.verbosity setting is Verbosity.verbose. At
This patch ensures that ~hypothesis.note prints the note for every test case when the ~hypothesis.settings.verbosity setting is Verbosity.verbose. At normal verbosity it only prints from the final test case.
Thanks to Tom McDermott for writing this patch at the PyCon Australia sprints!
One column per quarter.