Hypothesis

Latest version: v6.104.0

Safety actively analyzes 640762 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 66 of 198

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

Not secure
------------------

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

Not secure
------------------

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

Not secure
------------------

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

Not secure
------------------

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

Not secure
-------------------

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.

Page 66 of 198

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.