binaryornot icon indicating copy to clipboard operation
binaryornot copied to clipboard

Pin hypothesis to latest version 6.44.0

Open pyup-bot opened this issue 3 years ago • 0 comments

This PR pins hypothesis to the latest release 6.44.0.

Changelog

6.44.0

-------------------

This release adds the option to pass strategies for generating names for:
 * :class:`pandas.Index` created via :func:`~hypothesis.extra.pandas.indexes`
 * :class:`pandas.Series` created via :func:`~hypothesis.extra.pandas.series`

Hacked together by Sam Watts :)

6.43.3

-------------------

This patch updates the type annotations for :func:`given <hypothesis.given>`
so that type-checkers will warn on mixed positional and keyword arguments,
as well as fixing :issue:`3296`.

6.43.2

-------------------

Fixed a type annotation for ``pyright --strict`` (:issue:`3287`).

6.43.1

-------------------

This patch makes it an explicit error to call
:func:`~hypothesis.strategies.register_type_strategy` with a
`Pydantic GenericModel <https://pydantic-docs.helpmanual.io/usage/models/#generic-models>`__
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 :issue:`2940` for more details.

6.43.0

-------------------

This release makes it an explicit error to apply
:func:`pytest.fixture <pytest:pytest.fixture>` to a function which has
already been decorated with :func:`given() <hypothesis.given>`.  Previously,
``pytest`` would convert your test to a fixture, and then never run it.

6.42.3

-------------------

This patch fixes :func:`~hypothesis.strategies.from_type` on a :class:`~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!

6.42.2

-------------------

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 <https://github.com/pytest-dev/pytest/issues/1126#issuecomment-484581283>`__,
`this pytest issue <https://github.com/pytest-dev/pytest/issues/7767#issuecomment-1082436256>`__,
and :issue:`1935`

Thanks to Brandon Chinn for this bug fix!

6.42.1

-------------------

This patch fixes pretty-printing of regular expressions in Python 3.11.0a7, and
updates our vendored `list of top-level domains <https://www.iana.org/domains/root/db>`__,.

6.42.0

-------------------

This release makes ``st.functions(pure=True)`` less noisy (:issue:`3253`),
and generally improves pretty-printing of functions.

6.41.0

-------------------

This release changes the implementation of :const:`~hypothesis.infer` to be an alias
for :obj:`python:Ellipsis`. E.g. ``given(a=infer)`` is now equivalent to ``given(a=...)``. Furthermore, ``given(...)`` can now be specified so that
:func:`given <hypothesis.given>` will infer the strategies for *all* arguments of the
decorated function based on its annotations.

6.40.3

-------------------

This patch simplifies the repr of the strategies namespace returned in
:func:`~hypothesis.extra.array_api.make_strategies_namespace`, e.g.

.. code-block:: pycon

 >>> 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)

6.40.2

-------------------

Fixed :func:`~hypothesis.strategies.from_type` support for
:pep:`604` union types, like ``int | None`` (:issue:`3255`).

6.40.1

-------------------

Fixed an internal error when ``given()`` was passed a lambda.

6.40.0

-------------------

:doc:`The Ghostwriter <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 (:issue:`3267`).

6.39.6

-------------------

This patch makes some quality-of-life improvements to the
:doc:`Ghostwriter <ghostwriter>`: we guess the :func:`~hypothesis.strategies.text`
strategy for arguments named ``text`` (...obvious in hindsight, eh?);
and improved the error message if you accidentally left in a
:func:`~hypothesis.strategies.nothing` or broke your :pypi:`rich` install.

6.39.5

-------------------

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 :func:`~hypothesis.strategies.floats` strategy but can be disabled by
`unsafe compiler options <https://simonbyrne.github.io/notes/fastmath/>`__
(:issue:`3265`).

6.39.4

-------------------

This patch tweaks some internal formatting.  There is no user-visible change.

6.39.3

-------------------

If the :obj:`~hypothesis.Phase.shrink` phase is disabled, we now stop the
:obj:`~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 (:issue:`3244`).

6.39.2

-------------------

This patch clarifies rare error messages in
:func:`~hypothesis.strategies.builds` (:issue:`3225`) and
:func:`~hypothesis.strategies.floats` (:issue:`3207`).

6.39.1

-------------------

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
:pypi:`pytest-asyncio` (:issue:`3245`).

6.39.0

-------------------

This release improves Hypothesis' handling of positional-only arguments,
which are now allowed :func:`st.composite <hypothesis.strategies.composite>`
strategies.

On Python 3.8 and later, the first arguments to :func:`~hypothesis.strategies.builds`
and :func:`~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.

6.38.0

-------------------

This release makes :func:`~hypothesis.strategies.floats` error *consistently* when
your floating-point hardware has been configured to violate IEEE-754 for
:wikipedia:`subnormal numbers <Subnormal_number>`, instead of
only when an internal assertion was tripped (:issue:`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 <https://simonbyrne.github.io/notes/fastmath/>`__ explainer first.

6.37.2

-------------------

This patch fixes a bug in stateful testing, where returning a single value
wrapped in :func:`~hypothesis.stateful.multiple` would be printed such that
the assigned variable was a tuple rather than the single element
(:issue:`3236`).

6.37.1

-------------------

This patch fixes a warning under :pypi:`pytest` 7 relating to our
rich traceback display logic (:issue:`3223`).

6.37.0

-------------------

When distinguishing multiple errors, Hypothesis now looks at the inner
exceptions of :pep:`654` ``ExceptionGroup``\ s.

6.36.2

-------------------

This patch updates our vendored `list of top-level domains <https://www.iana.org/domains/root/db>`__,
which is used by the provisional :func:`~hypothesis.provisional.domains` strategy.

6.36.1

-------------------

This patch fixes some deprecation warnings from :pypi:`pytest` 7.0,
along with some code formatting and docs updates.

6.36.0

-------------------

This release disallows using :obj:`python:typing.Final`
with :func:`~hypothesis.strategies.from_type`
and :func:`~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.

6.35.1

-------------------

This patch fixes ``hypothesis write`` output highlighting with :pypi:`rich`
version 12.0 and later.

6.35.0

-------------------

This release disallows using :obj:`python:typing.ClassVar`
with :func:`~hypothesis.strategies.from_type`
and :func:`~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.

6.34.2

-------------------

This patch updates our vendored `list of top-level domains <https://www.iana.org/domains/root/db>`__,
which is used by the provisional :func:`~hypothesis.provisional.domains` strategy.

6.34.1

-------------------

This patch fixes :issue:`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.

6.34.0

-------------------

This release fixes :issue:`3133` and :issue:`3144`, where attempting
to generate Pandas series of lists or sets would fail with confusing
errors if you did not specify ``dtype=object``.

6.33.0

-------------------

This release disallows using :obj:`python:typing.TypeAlias`
with :func:`~hypothesis.strategies.from_type`
and :func:`~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 :issue:`2978`.

6.32.1

-------------------

This patch updates our autoformatting tools, improving our code style without any API changes.

6.32.0

-------------------

This release drops support for Python 3.6, which `reached end of life upstream
<https://devguide.python.org/#status-of-python-branches>`__ on 2021-12-23.

6.31.6

-------------------

This patch adds a temporary hook for a downstream tool,
which is not part of the public API.

6.31.5

-------------------

This release updates our copyright headers to `use a general authorship statement and omit the year
<https://www.linuxfoundation.org/blog/copyright-notices-in-open-source-software-projects/>`__.

6.31.4

-------------------

This patch makes the ``.example()`` method more representative of
test-time data generation, albeit often at a substantial cost to
readability (:issue:`3182`).

6.31.3

-------------------

This patch improves annotations on some of Hypothesis' internal functions, in order to
deobfuscate the signatures of some strategies. In particular, strategies shared between
:ref:`hypothesis.extra.numpy <hypothesis-numpy>` and
:ref:`the hypothesis.extra.array_api extra <array-api>` will benefit from this patch.

6.31.2

-------------------

This patch fix invariants display in stateful falsifying examples (:issue:`3185`).

6.31.1

-------------------

This patch updates :func:`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 <https://github.com/data-apis/array-api/pull/272>`_).

6.31.0

-------------------

This release makes us compatible with :pypi:`Django` 4.0, in particular by adding
support for use of :mod:`zoneinfo` timezones (though we respect the new
``USE_DEPRECATED_PYTZ`` setting if you need it).

6.30.1

-------------------

This patch updates our vendored `list of top-level domains <https://www.iana.org/domains/root/db>`__,
which is used by the provisional :func:`~hypothesis.provisional.domains` strategy.

6.30.0

-------------------

This release adds an ``allow_subnormal`` argument to the
:func:`~hypothesis.strategies.floats` strategy, which can explicitly toggle the
generation of :wikipedia:`subnormal floats <Subnormal_number>` (:issue:`3155`).
Disabling such generation is useful when testing flush-to-zero builds of
libraries.

:func:`nps.from_dtype() <hypothesis.extra.numpy.from_dtype>` and
:func:`xps.from_dtype` can also accept the ``allow_subnormal`` argument, and
:func:`xps.from_dtype` or :func:`xps.arrays` will disable subnormals by default
if the array module ``xp`` is detected to flush-to-zero (like is typical with
CuPy).

6.29.3

-------------------

This patch fixes a bug in :func:`~hypothesis.extra.numpy.mutually_broadcastable_shapes`,
which restricted the patterns of singleton dimensions that could be generated for
dimensions that extended beyond ``base_shape`` (:issue:`3170`).

6.29.2

-------------------

This patch clarifies our pretty-printing of DataFrames (:issue:`3114`).

6.29.1

-------------------

This patch documents :func:`~hypothesis.strategies.timezones`
`Windows-only requirement <https://docs.python.org/3/library/zoneinfo.html#data-sources>`__
for the :pypi:`tzdata` package, and ensures that
``pip install hypothesis[zoneinfo]`` will install the latest version.

6.29.0

-------------------

This release teaches :func:`~hypothesis.strategies.builds` to use
:func:`~hypothesis.strategies.deferred` when resolving unrecognised type hints,
so that you can conveniently register strategies for recursive types
with constraints on some arguments (:issue:`3026`):

.. code-block:: python

 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))
 )

6.28.1

-------------------

This release fixes some internal calculations related to collection sizes (:issue:`3143`).

6.28.0

-------------------

This release modifies our :pypi:`pytest` plugin, to avoid importing Hypothesis
and therefore triggering :ref:`Hypothesis' entry points <entry-points>` for
test suites where Hypothesis is installed but not actually used (:issue:`3140`).

6.27.3

-------------------

This release fixes :issue:`3080`, where :func:`~hypothesis.strategies.from_type`
failed on unions containing :pep:`585` builtin generic types (like ``list[int]``)
in Python 3.9 and later.

6.27.2

-------------------

This patch makes the :command:`hypothesis codemod`
:ref:`command <hypothesis-cli>` somewhat faster.

6.27.1

-------------------

This patch changes the backing datastructures of :func:`~hypothesis.register_random`
and a few internal caches to use :class:`weakref.WeakKeyDictionary`.  This reduces
memory usage and may improve performance when registered :class:`~random.Random`
instances are only used for a subset of your tests (:issue:`3131`).

6.27.0

-------------------

This release teaches Hypothesis' multiple-error reporting to format tracebacks
using :pypi:`pytest` or :pypi:`better-exceptions`, if they are installed and
enabled (:issue:`3116`).

6.26.0

-------------------

Did you know that of the 2\ :superscript:`64` possible floating-point numbers,
2\ :superscript:`53` 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 <https://wingolog.org/archives/2011/05/18/value-representation-in-javascript-implementations>`__,
and :wikipedia:`'signaling' nans might trap or error <https://en.wikipedia.org/wiki/NaN#Signaling_NaN>`.
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.

6.25.0

-------------------

This release adds special filtering logic to make a few special cases
like ``s.map(lambda x: x)`` and ``lists().filter(len)`` more efficient
(:issue:`2701`).

6.24.6

-------------------

This patch makes :func:`~hypothesis.strategies.floats` generate
:wikipedia:`"subnormal" floating point numbers <Subnormal_number>`
more often, as these rare values can have strange interactions with
`unsafe compiler optimisations like -ffast-math
<https://simonbyrne.github.io/notes/fastmath/#flushing_subnormals_to_zero>`__
(:issue:`2976`).

6.24.5

-------------------

This patch fixes a rare internal error in the :func:`~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 :pypi:`pytz` timezone (which predates :pep:`495`).

6.24.4

-------------------

This patch gives Hypothesis it's own internal :class:`~random.Random` instance,
ensuring that test suites which reset the global random state don't induce
weird correlations between property-based tests (:issue:`2135`).

6.24.3

-------------------

This patch updates documentation of :func:`~hypothesis.note`
(:issue:`3147`).

6.24.2

-------------------

This patch updates internal testing for the :ref:`Array API extra <array-api>`
to be consistent with new specification changes: ``sum()`` not accepting
boolean arrays (`234 <https://github.com/data-apis/array-api/pull/234>`_),
``unique()`` split into separate functions
(`275 <https://github.com/data-apis/array-api/pull/275>`_), and treating NaNs
as distinct (`310 <https://github.com/data-apis/array-api/pull/310>`_). It has
no user visible impact.

6.24.1

-------------------

This patch updates our vendored `list of top-level domains <https://www.iana.org/domains/root/db>`__,
which is used by the provisional :func:`~hypothesis.provisional.domains` strategy.

6.24.0

-------------------

This patch updates our vendored `list of top-level domains
<https://data.iana.org/TLD/tlds-alpha-by-domain.txt>`__, which is used
by the provisional :func:`~hypothesis.provisional.domains` strategy.

(did you know that gTLDs can be both `added <https://newgtlds.icann.org/en/>`__
and `removed <https://www.icann.org/resources/pages/gtld-registry-agreement-termination-2015-10-09-en>`__?)

6.23.4

-------------------

This patch adds an error for when ``shapes`` in :func:`xps.arrays()` is not
passed as either a valid shape or strategy.

6.23.3

-------------------

This patch updates our formatting with :pypi:`shed`.

6.23.2

-------------------

This patch replaces external links to :doc:`NumPy <numpy:index>` API docs
with :mod:`sphinx.ext.intersphinx` cross-references. It is purely a documentation improvement.

6.23.1

-------------------

This patch cleans up internal logic for :func:`xps.arrays()`. There is no
user-visible change.

6.23.0

-------------------

This release follows :pypi:`pytest` in considering :class:`SystemExit` and
:class:`GeneratorExit` exceptions to be test failures, meaning that we will
shink to minimal examples and check for flakiness even though they subclass
:class:`BaseException` directly (:issue:`2223`).

:class:`KeyboardInterrupt` continues to interrupt everything, and will be
re-raised immediately.

6.22.0

-------------------

This release adds :class:`~hypothesis.extra.django.LiveServerTestCase` and
:class:`~hypothesis.extra.django.StaticLiveServerTestCase` for django test.
Thanks to Ivan Tham for this feature!

6.21.6

-------------------

This patch fixes some new linter warnings such as :pypi:`flake8-bugbear`'s
``B904`` for explicit exception chaining, so tracebacks might be a bit nicer.

6.21.5

-------------------

This release fixes ``None`` being inferred as the float64 dtype in
:func:`~xps.from_dtype()` and :func:`~xps.arrays()` from the
:ref:`Array API extra <array-api>`.

6.21.4

-------------------

This release fixes the type hint for the
:func:`given() <hypothesis.given>` decorator
when decorating an ``async`` function (:issue:`3099`).

6.21.3

-------------------

This release improves Ghostwritten tests for builtins (:issue:`2977`).

6.21.2

-------------------

This release deprecates use of both ``min_dims > len(shape)`` and
``max_dims > len(shape)`` when ``allow_newaxis == False`` in
:func:`~hypothesis.extra.numpy.basic_indices` (:issue:`3091`).

6.21.1

-------------------

This release improves the behaviour of :func:`~hypothesis.strategies.builds`
and :func:`~hypothesis.strategies.from_type` in certain situations involving
decorators (:issue:`2495` and :issue:`3029`).

6.21.0

-------------------

This release introduces strategies for array/tensor libraries adopting the
`Array API standard <https://data-apis.org/>`__ (:issue:`3037`).
They are available in :ref:`the hypothesis.extra.array_api extra <array-api>`,
and work much like the existing :doc:`strategies for NumPy <numpy>`.

6.20.1

-------------------

This patch fixes :issue:`961`, where calling ``given()`` inline on a
bound method would fail to handle the ``self`` argument correctly.

6.20.0

-------------------

This release allows :func:`~hypothesis.strategies.slices` to generate ``step=None``,
and fixes an off-by-one error where the ``start`` index could be equal to ``size``.
This works fine for all Python sequences and Numpy arrays, but is undefined behaviour
in the `Array API standard <https://data-apis.org/>`__ (see :pull:`3065`).

6.19.0

-------------------

This release makes :doc:`stateful testing <stateful>` more likely to tell you
if you do something unexpected and unsupported:

- The :obj:`~hypothesis.HealthCheck.return_value` health check now applies to
:func:`~hypothesis.stateful.rule` and :func:`~hypothesis.stateful.initialize`
rules, if they don't have ``target`` bundles, as well as
:func:`~hypothesis.stateful.invariant`.
- Using a :func:`~hypothesis.stateful.consumes` bundle as a ``target`` is
deprecated, and will be an error in a future version.

If existing code triggers these new checks, check for related bugs and
misunderstandings - these patterns *never* had any effect.

6.18.0

-------------------

This release teaches :func:`~hypothesis.strategies.from_type` a neat trick:
when resolving an :obj:`python:typing.Annotated` type, if one of the annotations
is a strategy object we use that as the inferred strategy.  For example:

.. code-block:: python

 PositiveInt = Annotated[int, st.integers(min_value=1)]

If there are multiple strategies, we use the last outer-most annotation.
See :issue:`2978` and :pull:`3082` for discussion.

*Requires Python 3.9 or later for*
:func:`get_type_hints(..., include_extras=False) <typing.get_type_hints>`.

6.17.4

-------------------

This patch makes unique :func:`~hypothesis.extra.numpy.arrays` much more
efficient, especially when there are only a few valid elements - such as
for eight-bit integers (:issue:`3066`).

6.17.3

-------------------

This patch fixes the repr of :func:`~hypothesis.extra.numpy.array_shapes`.

6.17.2

-------------------

This patch wraps some internal helper code in our proxies decorator to prevent
mutations of method docstrings carrying over to other instances of the respective
methods.

6.17.1

-------------------

This patch moves some internal helper code in preparation for :issue:`3065`.
There is no user-visible change, unless you depended on undocumented internals.

6.17.0

-------------------

This release adds type annotations to the :doc:`stateful testing <stateful>` API.

Thanks to Ruben Opdebeeck for this contribution!

6.16.0

-------------------

This release adds the :class:`~hypothesis.strategies.DrawFn` type as a reusable
type hint for the ``draw`` argument of
:func:`composite <hypothesis.strategies.composite>` functions.

Thanks to Ruben Opdebeeck for this contribution!

6.15.0

-------------------

This release emits a more useful error message when :func:`given() <hypothesis.given>`
is applied to a coroutine function, i.e. one defined using ``async def`` (:issue:`3054`).

This was previously only handled by the generic :obj:`~hypothesis.HealthCheck.return_value`
health check, which doesn't direct you to use either :ref:`a custom executor <custom-function-execution>`
or a library such as :pypi:`pytest-trio` or :pypi:`pytest-asyncio` to handle it for you.

6.14.9

-------------------

This patch fixes a regression in Hypothesis 6.14.8, where :func:`~hypothesis.strategies.from_type`
failed to resolve types which inherit from multiple parametrised generic types,
affecting the :pypi:`returns` package (:issue:`3060`).

6.14.8

-------------------

This patch ensures that registering a strategy for a subclass of a a parametrised
generic type such as ``class Lines(Sequence[str]):`` will not "leak" into unrelated
strategies such as ``st.from_type(Sequence[int])`` (:issue:`2951`).
Unfortunately this fix requires :pep:`560`, meaning Python 3.7 or later.

6.14.7

-------------------

This patch fixes :issue:`3050`, where :pypi:`attrs` classes could
cause an internal error in the :doc:`ghostwriter <ghostwriter>`.

6.14.6

-------------------

This patch improves the error message for :issue:`3016`, where :pep:`585`
builtin generics with self-referential forward-reference strings cannot be
resolved to a strategy by :func:`~hypothesis.strategies.from_type`.

6.14.5

-------------------

This patch fixes ``hypothesis.strategies._internal.types.is_a_new_type``.
It was failing on Python ``3.10.0b4``, where ``NewType`` is a function.

6.14.4

-------------------

This patch fixes :func:`~hypothesis.strategies.from_type` and
:func:`~hypothesis.strategies.register_type_strategy` for
:obj:`python:typing.NewType` on Python 3.10, which changed the
underlying implementation (see :bpo:`44353` for details).

6.14.3

-------------------

This patch updates our autoformatting tools, improving our code style without any API changes.

6.14.2

-------------------

This patch ensures that we shorten tracebacks for tests which fail due
to inconsistent data generation between runs (i.e. raise ``Flaky``).

6.14.1

-------------------

This patch updates some internal type annotations.
There is no user-visible change.

6.14.0

-------------------

The :ref:`explain phase <phases>` now requires shrinking to be enabled,
and will be automatically skipped for deadline-exceeded errors.

6.13.14

--------------------

This patch improves the :func:`~hypothesis.strategies.tuples` strategy
type annotations, to preserve the element types for up to length-five
tuples (:issue:`3005`).

As for :func:`~hypothesis.strategies.one_of`, this is the best we can do
before a `planned extension <https://mail.python.org/archives/list/typing-sigpython.org/thread/LOQFV3IIWGFDB7F5BDX746EZJG4VVBI3/>`__
to :pep:`646` is released, hopefully in Python 3.11.

6.13.13

--------------------

This patch teaches :doc:`the Ghostwriter <ghostwriter>` how to find
:doc:`custom ufuncs <numpy:reference/ufuncs>` from *any* module that defines them,
and that ``yaml.unsafe_load()`` does not undo ``yaml.safe_load()``.

6.13.12

--------------------

This patch reduces the amount of internal code excluded from our test suite's
code coverage checks.

There is no user-visible change.

6.13.11

--------------------

This patch removes some old internal helper code that previously existed
to make Python 2 compatibility easier.

There is no user-visible change.

6.13.10

--------------------

This release adjusts some internal code to help make our test suite more
reliable.

There is no user-visible change.

6.13.9

-------------------

This patch cleans up some internal code related to filtering strategies.

There is no user-visible change.

6.13.8

-------------------

This patch slightly improves the performance of some internal code for
generating integers.

6.13.7

-------------------

This patch fixes a bug in :func:`~hypothesis.strategies.from_regex` that
caused ``from_regex("", fullmatch=True)`` to unintentionally generate non-empty
strings (:issue:`4982`).

The only strings that completely match an empty regex pattern are empty
strings.

6.13.6

-------------------

This patch fixes a bug that caused :func:`~hypothesis.strategies.integers`
to shrink towards negative values instead of positive values in some cases.

6.13.5

-------------------

This patch fixes rare cases where ``hypothesis write --binary-op`` could
print :doc:`reproducing instructions <reproducing>` from the internal
search for an identity element.

6.13.4

-------------------

This patch removes some unnecessary intermediate list-comprehensions,
using the latest versions of :pypi:`pyupgrade` and :pypi:`shed`.

6.13.3

-------------------

This patch adds a ``.hypothesis`` property to invalid test functions, bringing
them inline with valid tests and fixing a bug where :pypi:`pytest-asyncio` would
swallow the real error message and mistakenly raise a version incompatibility
error.

6.13.2

-------------------

Some of Hypothesis's numpy/pandas strategies use a ``fill`` argument to speed
up generating large arrays, by generating a single fill value and sharing that
value among many array slots instead of filling every single slot individually.

When no ``fill`` argument is provided, Hypothesis tries to detect whether it is
OK to automatically use the ``elements`` argument as a fill strategy, so that
it can still use the faster approach.

This patch fixes a bug that would cause that optimization to trigger in some
cases where it isn't 100% guaranteed to be OK.

If this makes some of your numpy/pandas tests run more slowly, try adding an
explicit ``fill`` argument to the relevant strategies to ensure that Hypothesis
always uses the faster approach.

6.13.1

-------------------

This patch strengthens some internal import-time consistency checks for the
built-in strategies.

There is no user-visible change.

6.13.0

-------------------

This release adds URL fragment generation to the :func:`~hypothesis.provisional.urls`
strategy (:issue:`2908`). Thanks to Pax (R. Margret) for contributing this patch at the
`PyCon US Mentored Sprints <https://us.pycon.org/2021/summits/mentored-sprints/>`__!

6.12.1

-------------------

This patch fixes :issue:`2964`, where ``.map()`` and ``.filter()`` methods
were omitted from the ``repr()`` of :func:`~hypothesis.strategies.just` and
:func:`~hypothesis.strategies.sampled_from` strategies, since
:ref:`version 5.43.7 <v5.43.7>`.

6.12.0

-------------------

This release automatically rewrites some simple filters, such as
``integers().filter(lambda x: x > 9)`` to the more efficient
``integers(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. :pypi:`pandera` "``Checks``"
where you already have a simple predicate and translating manually
is really annoying.  See :issue:`2701` for ideas about floats and
simple text strategies.

6.11.0

-------------------

:func:`hypothesis.target` now returns the ``observation`` value,
allowing it to be conveniently used inline in expressions such as
``assert target(abs(a - b)) < 0.1``.

6.10.1

-------------------

This patch fixes a deprecation warning if you're using recent versions
of :pypi:`importlib-metadata` (:issue:`2934`), which we use to load
:ref:`third-party plugins <entry-points>` such as `Pydantic's integration
<https://pydantic-docs.helpmanual.io/hypothesis_plugin/>`__.
On older versions of :pypi:`importlib-metadata`, there is no change and
you don't need to upgrade.

6.10.0

-------------------

This release teaches the :doc:`Ghostwriter <ghostwriter>` to read parameter
types from Sphinx, Google, or Numpy-style structured docstrings, and improves
some related heuristics about how to test scientific and numerical programs.

6.9.2

------------------

This release improves the :doc:`Ghostwriter's <ghostwriter>` handling
of exceptions, by reading ``:raises ...:`` entries in function docstrings
and ensuring that we don't suppresss the error raised by test assertions.

6.9.1

------------------

This patch updates our autoformatting tools, improving our code style without any API changes.

6.9.0

------------------

This release teaches :func:`~hypothesis.strategies.from_type` how to see
through :obj:`python:typing.Annotated`.  Thanks to Vytautas Strimaitis
for reporting and fixing :issue:`2919`!

6.8.12

-------------------

If :pypi:`rich` is installed, the :command:`hypothesis write` command
will use it to syntax-highlight the :doc:`Ghostwritten <ghostwriter>`
code.

6.8.11

-------------------

This patch improves an error message from :func:`~hypothesis.strategies.builds`
when :func:`~hypothesis.strategies.from_type` would be more suitable (:issue:`2930`).

6.8.10

-------------------

This patch updates the type annotations for :func:`~hypothesis.extra.numpy.arrays` to reflect that
``shape: SearchStrategy[int]`` is supported.

6.8.9

------------------

This patch fixes :func:`~hypothesis.strategies.from_type` with
:mod:`abstract types <python:abc>` which have either required but
non-type-annotated arguments to ``__init__``, or where
:func:`~hypothesis.strategies.from_type` can handle some concrete
subclasses but not others.

6.8.8

------------------

This patch teaches :command:`hypothesis write` to check for possible roundtrips
in several more cases, such as by looking for an inverse in the module which
defines the function to test.

6.8.7

------------------

This patch adds a more helpful error message if you try to call
:func:`~hypothesis.strategies.sampled_from` on an :class:`~python:enum.Enum`
which has no members, but *does* have :func:`~python:dataclasses.dataclass`-style
annotations (:issue:`2923`).

6.8.6

------------------

The :func:`~hypothesis.strategies.fixed_dictionaries` strategy now preserves
dict iteration order instead of sorting the keys.  This also affects the
pretty-printing of keyword arguments to :func:`given() <hypothesis.given>`
(:issue:`2913`).

6.8.5

------------------

This patch teaches :command:`hypothesis write` to default to ghostwriting
tests with ``--style=pytest`` only if :pypi:`pytest` is installed, or
``--style=unittest`` otherwise.

6.8.4

------------------

This patch adds type annotations for the :class:`~hypothesis.settings` decorator,
to avoid an error when running mypy in strict mode.

6.8.3

------------------

This patch improves the :doc:`Ghostwriter's <ghostwriter>` handling
of strategies to generate various fiddly types including frozensets,
keysviews, valuesviews, regex matches and patterns, and so on.

6.8.2

------------------

This patch fixes some internal typos.  There is no user-visible change.

6.8.1

------------------

This patch lays more groundwork for filter rewriting (:issue:`2701`).
There is no user-visible change... yet.

6.8.0

------------------

This release :func:`registers <hypothesis.strategies.register_type_strategy>` the
remaining builtin types, and teaches :func:`~hypothesis.strategies.from_type` to
try resolving :class:`~python:typing.ForwardRef` and :class:`~python:typing.Type`
references to built-in types.

6.7.0

------------------

This release teaches :class:`~hypothesis.stateful.RuleBasedStateMachine` to avoid
checking :func:`~hypothesis.stateful.invariant`\ s until all
:func:`~hypothesis.stateful.initialize` rules have been run.  You can enable checking
of specific invariants for incompletely initialized machines by using
``invariant(check_during_init=True)`` (:issue:`2868`).

In previous versions, it was possible if awkward to implement this behaviour
using :func:`~hypothesis.stateful.precondition` and an auxiliary variable.

6.6.1

------------------

This patch improves the error message when :func:`~hypothesis.strategies.from_type`
fails to resolve a forward-reference inside a :class:`python:typing.Type`
such as ``Type["int"]`` (:issue:`2565`).

6.6.0

------------------

This release makes it an explicit error to apply :func:`~hypothesis.stateful.invariant`
to a :func:`~hypothesis.stateful.rule` or :func:`~hypothesis.stateful.initialize` rule
in :doc:`stateful testing <stateful>`.  Such a combination had unclear semantics,
especially in combination with :func:`~hypothesis.stateful.precondition`, and was never
meant to be allowed (:issue:`2681`).

6.5.0

------------------

This release adds :ref:`the explain phase <phases>`, in which Hypothesis
attempts to explain *why* your test failed by pointing to suspicious lines
of code (i.e. those which were always, and only, run on failing inputs).
We plan to include "generalising" failing examples in this phase in a
future release (:issue:`2192`).

6.4.3

------------------

This patch fixes :issue:`2794`, where nesting :func:`~hypothesis.strategies.deferred`
strategies within :func:`~hypothesis.strategies.recursive` strategies could
trigger an internal assertion.  While it was always possible to get the same
results from a more sensible strategy, the convoluted form now works too.

6.4.2

------------------

This patch fixes several problems with ``mypy`` when `--no-implicit-reexport <https://mypy.readthedocs.io/en/stable/command_line.html#cmdoption-mypy-no-implicit-reexport>`_ was activated in user projects.

Thanks to Nikita Sobolev for fixing :issue:`2884`!

6.4.1

------------------

This patch fixes an exception that occurs when using type unions of
the :pypi:`typing_extensions` ``Literal`` backport on Python 3.6.

Thanks to Ben Anhalt for identifying and fixing this bug.

6.4.0

------------------

This release fixes :doc:`stateful testing methods <stateful>` with multiple
:func:`~hypothesis.stateful.precondition` decorators.  Previously, only the
outer-most precondition was checked (:issue:`2681`).

6.3.4

------------------

This patch refactors some internals of :class:`~hypothesis.stateful.RuleBasedStateMachine`.
There is no change to the public API or behaviour.

6.3.3

------------------

This patch moves some internal code, so that future work can avoid
creating import cycles.  There is no user-visible change.

6.3.2

------------------

This patch enables :func:`~hypothesis.strategies.register_type_strategy` for subclasses of
:class:`python:typing.TypedDict`.  Previously, :func:`~hypothesis.strategies.from_type`
would ignore the registered strategy (:issue:`2872`).

Thanks to Ilya Lebedev for identifying and fixing this bug!

6.3.1

------------------

This release lays the groundwork for automatic rewriting of simple filters,
for example converting ``integers().filter(lambda x: x > 9)`` to
``integers(min_value=10)``.

Note that this is **not supported yet**, and we will continue to recommend
writing the efficient form directly wherever possible - predicate rewriting
is provided mainly for the benefit of downstream libraries which would
otherwise have to implement it for themselves (e.g. :pypi:`pandera` and
:pypi:`icontract-hypothesis`).  See :issue:`2701` for details.

6.3.0

------------------

The Hypothesis :pypi:`pytest` plugin now requires pytest version 4.6 or later.
If the plugin detects an earlier version of pytest, it will automatically
deactivate itself.

`(4.6.x is the earliest pytest branch that still accepts community bugfixes.)
<https://docs.pytest.org/en/stable/py27-py34-deprecation.html>`__

Hypothesis-based tests should continue to work in earlier versions of
pytest, but enhanced integrations provided by the plugin
(such as ``--hypothesis-show-statistics`` and other command-line flags)
will no longer be available in obsolete pytest versions.

6.2.0

------------------

If you use :pypi:`pytest-html`, Hypothesis now includes the
:ref:`summary statistics for each test <statistics>` in the HTML report,
whether or not the ``--hypothesis-show-statistics`` argument was passed
to show them in the command-line output.

6.1.1

------------------

This patch updates our automatic code formatting to use :pypi:`shed`,
which includes :pypi:`autoflake`, :pypi:`black`, :pypi:`isort`, and
:pypi:`pyupgrade` (:issue:`2780`).

6.1.0

------------------

This release teaches Hypothesis to distinguish between errors based on the
`__cause__ or __context__ of otherwise identical exceptions
<https://docs.python.org/3/library/exceptions.html>`__, which is particularly
useful when internal errors can be wrapped by a library-specific or semantically
appropriate exception such as:

.. code-block:: python

 try:
     do_the_thing(foo, timeout=10)
 except Exception as err:
     raise FooError("Failed to do the thing") from err

Earlier versions of Hypothesis only see the ``FooError``, while we can now
distinguish a ``FooError`` raised because of e.g. an internal assertion from
one raised because of a ``TimeoutExceeded`` exception.

6.0.4

------------------

This release prevents a race condition inside :func:`~hypothesis.strategies.recursive` strategies.
The race condition occurs when the same :func:`~hypothesis.strategies.recursive` strategy is shared among tests
that are running in multiple threads (:issue:`2717`).

6.0.3

------------------

This patch improves the type annotations for :func:`~hypothesis.strategies.one_of`,
by adding overloads to handle up to five distinct arguments as
:obj:`~python:typing.Union` before falling back to :obj:`~python:typing.Any`,
as well as annotating the ``|`` (``__or__``) operator for strategies (:issue:`2765`).

6.0.2

------------------

This release makes some small improvements to how filtered strategies work. It should improve the performance of shrinking filtered strategies,
and may under some (probably rare) circumstances improve the diversity of generated examples.

6.0.1

------------------

This patch fixes an interaction where our :ref:`test statistics <statistics>`
handling made Pytest's ``--junit-xml`` output fail to validate against the
strict ``xunit2`` schema (:issue:`1975`).

6.0.0

------------------

Welcome to the next major version of Hypothesis!

There are no new features here, as we release those in minor versions.
Instead, 6.0 is a chance for us to remove deprecated features (many already
converted into no-ops), and turn a variety of warnings into errors.

If you were running on the last version of Hypothesis 5.x *without any
Hypothesis deprecation warnings*, this will be a very boring upgrade.
**In fact, nothing will change for you at all.**

Changes
~~~~~~~
- Many functions now use :pep:`3102` keyword-only arguments where passing positional
arguments :ref:`was deprecated since 5.5 <v5.5.0>`.
- :func:`hypothesis.extra.django.from_model` no longer accepts ``model`` as a
keyword argument, where it could conflict with fields named "model".
- :func:`~hypothesis.strategies.randoms` now defaults to ``use_true_random=False``.
- :func:`~hypothesis.strategies.complex_numbers` no longer accepts
``min_magnitude=None``; either use ``min_magnitude=0`` or just omit the argument.
- ``hypothesis.provisional.ip4_addr_strings`` and ``ip6_addr_strings`` are removed
in favor of :func:`ip_addresses(v=...).map(str) <hypothesis.strategies.ip_addresses>`.
- :func:`~hypothesis.strategies.register_type_strategy` no longer accepts generic
types with type arguments, which were always pretty badly broken.
- Using function-scoped pytest fixtures is now a health-check error, instead of a warning.

.. tip::
 The :command:`hypothesis codemod` command can automatically refactor your code,
 particularly to convert positional to keyword arguments where those are now
 required.

Hypothesis 5.x
==============

5.49.0

-------------------

This release adds the
:obj:`~hypothesis.HealthCheck.function_scoped_fixture` health check value,
which can be used to suppress the existing warning that appears when
:func:`given <hypothesis.given>` is applied to a test that uses pytest
function-scoped fixtures.

(This warning exists because function-scoped fixtures only run once per
function, not once per example, which is usually unexpected and can cause
subtle problems.)

When this warning becomes a health check error in a future release, suppressing
it via Python warning settings will no longer be possible.
In the rare case that once-per-function behaviour is intended, it will still be
possible to use :obj:`~hypothesis.HealthCheck.function_scoped_fixture` to
opt out of the health check error for specific tests.

5.48.0

-------------------

This release adds :func:`hypothesis.currently_in_test_context`, which can be used
to check whether the calling code is currently running inside an
:func:`given <hypothesis.given>` or :doc:`stateful <stateful>` test.

This is most useful for third-party integrations and assertion helpers which may
wish to use :func:`~hypothesis.assume` or :func:`~hypothesis.target`, without also
requiring that the helper only be used from property-based tests (:issue:`2581`).

5.47.0

-------------------

This release upgrades the import logic for :doc:`ghostwritten tests <ghostwriter>`,
handling many cases where imports would previously be missing or from unexpected
locations.

5.46.0

-------------------

This release upgrades :func:`~hypothesis.strategies.from_type`, to infer
strategies for type-annotated arguments even if they have defaults when
it otherwise falls back to :func:`~hypothesis.strategies.builds`
(:issue:`2708`).

5.45.0

-------------------

This release adds the :ref:`codemods` extra, which you can use to
check for and automatically fix issues such as use of deprecated
Hypothesis APIs (:issue:`2705`).

5.44.0

-------------------

This patch fixes :func:`~hypothesis.strategies.from_type` with
the :pypi:`typing_extensions` ``Literal`` backport on Python 3.6.

5.43.9

-------------------

This patch fixes :issue:`2722`, where certain orderings of
:func:`~hypothesis.strategies.register_type_strategy`,
:class:`~python:typing.ForwardRef`, and :func:`~hypothesis.strategies.from_type`
could trigger an internal error.

5.43.8

-------------------

This patch makes some strategies for collections with a uniqueness constraint
much more efficient, including ``dictionaries(keys=sampled_from(...), values=..)``
and ``lists(tuples(sampled_from(...), ...), unique_by=lambda x: x[0])``.
(related to :issue:`2036`)

5.43.7

-------------------

This patch extends our faster special case for
:func:`~hypothesis.strategies.sampled_from` elements in unique
:func:`~hypothesis.strategies.lists` to account for chains of
``.map(...)`` and ``.filter(...)`` calls (:issue:`2036`).

5.43.6

-------------------

This patch improves the type annotations on :func:`~hypothesis.assume`
and :func:`reproduce_failure() <hypothesis.reproduce_failure>`.

5.43.5

-------------------

This patch updates our copyright headers to include 2021.  Happy new year!

5.43.4

-------------------

This change fixes a documentation error in the
:obj:`~hypothesis.settings.database` setting.

The previous documentation suggested that callers could specify a database
path string, or the special string ``":memory:"``, but this setting has
never actually allowed string arguments.

Permitted values are ``None``, and instances of
:class:`~hypothesis.database.ExampleDatabase`.

5.43.3

-------------------

This patch fixes :issue:`2696`, an internal error triggered when the
:func:`example <hypothesis.example>` decorator was used and the
:obj:`~hypothesis.settings.verbosity` setting was ``quiet``.

5.43.2

-------------------

This patch improves the error message from the
:func:`~hypothesis.extra.pandas.data_frames` strategy when both the ``rows``
and ``columns`` arguments are given, but there is a missing entry in ``rows``
and the corresponding column has no ``fill`` value (:issue:`2678`).

5.43.1

-------------------

This patch improves the error message if :func:`~hypothesis.strategies.builds`
is passed an :class:`~python:enum.Enum` which cannot be called without arguments,
to suggest using :func:`~hypothesis.strategies.sampled_from` (:issue:`2693`).

5.43.0

-------------------

This release adds new :func:`~hypothesis.strategies.timezones` and
:func:`~hypothesis.strategies.timezone_keys` strategies (:issue:`2630`)
based on the new :mod:`python:zoneinfo` module in Python 3.9.

``pip install hypothesis[zoneinfo]`` will ensure that you have the
appropriate backports installed if you need them.

5.42.3

-------------------

This patch fixes an internal error in :func:`~hypothesis.strategies.datetimes`
with ``allow_imaginary=False`` where the ``timezones`` argument can generate
``tzinfo=None`` (:issue:`2662`).

5.42.2

-------------------

This patch teaches :func:`hypothesis.extra.django.from_field` to infer
more efficient strategies by inspecting (not just filtering by) field
validators for numeric and string fields (:issue:`1116`).

5.42.1

-------------------

This patch refactors :class:`hypothesis.settings` to use type-annotated
keyword arguments instead of ``**kwargs``, which makes tab-completion
much more useful - as well as type-checkers like :pypi:`mypy`.

5.42.0

-------------------

This patch teaches the :func:`~hypothesis.extra.ghostwriter.magic` ghostwriter
to recognise "en/de" function roundtrips other than the common encode/decode
pattern, such as encrypt/decrypt or, encipher/decipher.

5.41.5

-------------------

This patch adds a performance optimisation to avoid saving redundant
seeds when using :ref:`the .fuzz_one_input hook <fuzz_one_input>`.

5.41.4

-------------------

This patch fixes :issue:`2657`, where passing unicode patterns compiled with
:obj:`python:re.IGNORECASE` to :func:`~hypothesis.strategies.from_regex` could
trigger an internal error when casefolding a character creates a longer string
(e.g. ``"\u0130".lower() -> "i\u0370"``).

5.41.3

-------------------

This patch adds a final fallback clause to :ref:`our plugin logic <entry-points>`
to fail with a warning rather than error on Python < 3.8 when neither the
:pypi:`importlib_metadata` (preferred) or :pypi:`setuptools` (fallback)
packages are available.

5.41.2

-------------------

This patch fixes :func:`~hypothesis.provisional.urls` strategy ensuring that
``~`` (tilde) is treated as one of the url-safe characters (:issue:`2658`).

5.41.1

-------------------

This patch improves our :ref:`CLI help and documentation <hypothesis-cli>`.

5.41.0

-------------------

Hypothesis now shrinks examples where the error is raised while drawing from
a strategy.  This makes complicated custom strategies *much* easier to debug,
at the cost of a slowdown for use-cases where you catch and ignore such errors.

5.40.0

-------------------

This release teaches :func:`~hypothesis.strategies.from_type` how to handle
:class:`~python:typing.ChainMap`, :class:`~python:typing.Counter`,
:class:`~python:typing.Deque`, :class:`~python:typing.Generator`,
:class:`~python:typing.Match`, :class:`~python:typing.OrderedDict`,
:class:`~python:typing.Pattern`, and :class:`~python:collections.abc.Set`
(:issue:`2654`).

5.39.0

-------------------

:func:`~hypothesis.strategies.from_type` now knows how to resolve :pep:`585`
parameterized standard collection types, which are new in Python 3.9
(:issue:`2629`).

5.38.1

-------------------

This patch fixes :func:`~hypothesis.strategies.builds`, so that when passed
:obj:`~hypothesis.infer` for an argument with a non-:obj:`~python:typing.Optional`
type annotation and a default value of ``None`` to build a class which defines
an explicit ``__signature__`` attribute, either ``None`` or that type may be
generated.

This is unlikely to happen unless you are using :pypi:`pydantic` (:issue:`2648`).

5.38.0

-------------------

This release improves our support for :func:`st.composite <hypothesis.strategies.composite>`
on a :obj:`python:classmethod` or :obj:`python:staticmethod` (:issue:`2578`).

5.37.5

-------------------

This patch fixes :func:`~hypothesis.strategies.from_type` with
:class:`Iterable[T] <python:typing.Iterable>` (:issue:`2645`).

5.37.4

-------------------

This patch teaches the :func:`~hypothesis.extra.ghostwriter.magic` ghostwriter
to recognise that pairs of functions like :func:`~python:colorsys.rgb_to_hsv`
and :func:`~python:colorsys.hsv_to_rgb` should
:func:`~hypothesis.extra.ghostwriter.roundtrip`.

5.37.3

-------------------

This patch improves :func:`~hypothesis.strategies.builds` and
:func:`~hypothesis.strategies.from_type` support for explicitly defined ``__signature__``
attributes, from :ref:`version 5.8.3 <v5.8.3>`, to support generic types from the
:mod:`python:typing` module.

Thanks to Rónán Carrigan for identifying and fixing this problem!

5.37.2

-------------------

This patch fixes :func:`~hypothesis.extra.lark.from_lark` with version
0.10.1+ of the :pypi:`lark-parser` package.

5.37.1

-------------------

This patch fixes some broken links in the :mod:`~hypothesis.extra.lark`
extra documentation.

5.37.0

-------------------

This release adds a new :class:`~hypothesis.extra.redis.RedisExampleDatabase`,
along with the :class:`~hypothesis.database.ReadOnlyDatabase`
and :class:`~hypothesis.database.MultiplexedDatabase` helpers, to support
team workflows where failing examples can be seamlessly shared between everyone
on the team - and your CI servers or buildbots.

5.36.2

-------------------

This patch ensures that if the :ref:`"hypothesis" entry point <entry-points>`
is callable, we call it after importing it.  You can still use non-callable
entry points (like modules), which are only imported.

We also prefer `importlib.metadata <https://docs.python.org/3/library/importlib.metadata.html>`__
or :pypi:`the backport <importlib_metadata>` over `pkg_resources
<https://setuptools.readthedocs.io/en/latest/pkg_resources.html>`__,
which makes ``import hypothesis`` around 200 milliseconds faster
(:issue:`2571`).

5.36.1

-------------------

This patch adds some helpful suggestions to error messages you might see
while learning to use the :func:`example() <hypothesis.example>` decorator
(:issue:`2611`) or the :func:`~hypothesis.strategies.one_of` strategy.

5.36.0

-------------------

This release upgrades the :func:`~hypothesis.extra.numpy.from_dtype` strategy
to pass optional ``**kwargs`` to the inferred strategy, and upgrades the
:func:`~hypothesis.extra.numpy.arrays` strategy to accept an ``elements=kwargs``
dict to pass through to :func:`~hypothesis.extra.numpy.from_dtype`.

``arrays(floating_dtypes(), shape, elements={"min_value": -10, "max_value": 10})``
is a particularly useful pattern, as it allows for any floating dtype without
triggering the roundoff warning for smaller types or sacrificing variety for
larger types (:issue:`2552`).

5.35.4

-------------------

This patch reformats our code with the latest :pypi:`black` to
take advantage of the support for magic trailing commas.

5.35.3

-------------------

This release significantly improves the performance of Hypothesis's internal
implementation of automaton learning. However this code does not run as part
of the user-accessible API so this has no user-visible impact.

5.35.2

-------------------

This patch ensures that, when the ``generate`` :obj:`~hypothesis.settings.phases`
is disabled, we can replay up to :obj:`~hypothesis.settings.max_examples` examples
from the database - which is very useful when
:ref:`using Hypothesis with a fuzzer <fuzz_one_input>`.

Thanks to Afrida Tabassum for fixing :issue:`2585`!

5.35.1

-------------------

This patch changes some internal :obj:`python:struct.Struct.format` strings
from ``bytes`` to ``str``, to avoid :class:`python:BytesWarning` when running
`python -bb <https://docs.python.org/3/using/cmdline.html#cmdoption-b>`__.

Thanks to everyone involved in `pytest-xdist issue 596
<https://github.com/pytest-dev/pytest-xdist/issues/596>`__,
:bpo:`16349`, :bpo:`21071`, and :bpo:`41777` for their work on this -
it was a remarkably subtle issue!

5.35.0

-------------------

The :func:`~hypothesis.target` function now accepts integers as well as floats.

5.34.1

-------------------

This patch adds explicit :obj:`~python:typing.Optional` annotations to our public API,
to better support users who run :pypi:`mypy` with ``--strict`` or ``no_implicit_optional=True``.

Thanks to Krzysztof Przybyła for bringing this to our attention and writing the patch!

5.34.0

-------------------

This release drops support for Python 3.5, which `reached end of life upstream
<https://devguide.python.org/#status-of-python-branches>`__ on 2020-09-13.

5.33.2

-------------------

This patch fixes a problem with :func:`~hypothesis.strategies.builds` that was not able to
generate valid data for annotated classes with constructors.

Thanks to Nikita Sobolev for fixing :issue:`2603`!

5.33.1

-------------------

This patch improves the error message from the :command:`hypothesis write`
command if :pypi:`black` (required for the :doc:`ghostwriter <ghostwriter>`)
is not installed.

Thanks to Nikita Sobolev for fixing :issue:`2604`!

5.33.0

-------------------

When reporting failing examples, or tried examples in verbose mode, Hypothesis now
identifies which were from :func:`example(...) <hypothesis.example>` explicit examples.

5.32.1

-------------------

This patch contains some internal refactoring.
Thanks to Felix Sheldon for fixing :issue:`2516`!

5.32.0

-------------------

An array drawn from :func:`~hypothesis.extra.numpy.arrays` will own its own memory; previously most arrays returned by
this strategy were views.

5.31.0

-------------------

:func:`~hypothesis.strategies.builds` will use the ``__signature__`` attribute of
the target, if it exists, to retrieve type hints.
Previously :func:`python:typing.get_type_hints`, was used by default.
If argument names varied between the ``__annotations__`` and ``__signature__``,
they would not be supplied to the target.

This was particularly an issue for :pypi:`pydantic` models which use an
`alias generator <https://pydantic-docs.helpmanual.io/usage/model_config/#alias-generator>`__.

5.30.1

-------------------

pyup-bot avatar Apr 22 '22 03:04 pyup-bot