Hypothesis

Latest version: v6.122.3

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

Scan your dependencies

Page 67 of 210

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`.

Page 67 of 210

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.