Hypothesis

Latest version: v6.122.3

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

Scan your dependencies

Page 24 of 210

6.96.0

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

Warns when constructing a `repr` that is overly long. This can
happen by accident if stringifying arbitrary strategies, and
is expensive in time and memory. The associated deferring of
these long strings in :func:`~hypothesis.strategies.sampled_from`
should also lead to improved performance.

6.95.0

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

This release adds the ability to pass any object to :func:`~hypothesis.note`, instead of just strings. The pretty-printed representation of the object will be used.

See also :issue:`3843`.

6.94.0

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

This release avoids creating a ``.hypothesis`` directory when using
:func:`~hypothesis.strategies.register_type_strategy` (:issue:`3836`),
and adds warnings for plugins which do so by other means or have
other unintended side-effects.

6.93.2

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

This patch improves :doc:`observability <observability>` reports by moving
timing information from ``metadata`` to a new ``timing`` key, and supporting
conversion of additional argument types to json rather than string reprs
via a ``.to_json()`` method (including e.g. Pandas dataframes).

Additionally, the :obj:`~hypothesis.HealthCheck.too_slow` health check will
now report *which* strategies were slow, e.g. for strategies a, b, c, ...::

count | fraction | slowest draws (seconds)
a | 3 | 65% | -- -- -- 0.357, 2.000
b | 8 | 16% | 0.100, 0.100, 0.100, 0.111, 0.123
c | 3 | 8% | -- -- 0.030, 0.050, 0.200
(skipped 2 rows of fast draws)

6.93.1

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

This patch refactors some internals, continuing our work on supporting alternative backends
(:issue:`3086`). There is no user-visible change.

6.93.0

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

The :func:`~hypothesis.extra.lark.from_lark` strategy now accepts an ``alphabet=``
argument, which is passed through to :func:`~hypothesis.strategies.from_regex`,
so that you can e.g. constrain the generated strings to a particular codec.

In support of this feature, :func:`~hypothesis.strategies.from_regex` will avoid
generating optional parts which do not fit the alphabet. For example,
``from_regex(r"abc|def", alphabet="abcd")`` was previously an error, and will now
generate only ``'abc'``. Cases where there are no valid strings remain an error.

Page 24 of 210

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.