Hypothesis

Latest version: v6.99.13

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

Scan your dependencies

Page 9 of 194

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.

6.92.9

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

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

6.92.8

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

This patch adds a :ref:`test statistics <statistics>` event when a generated example is rejected via :func:`assume <hypothesis.assume>`.

This may also help with distinguishing ``gave_up`` examples in :doc:`observability <observability>` (:issue:`3827`).

6.92.7

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

This introduces the rewriting of length filters on some collection strategies (:issue:`3791`).

Thanks to Reagan Lee for implementing this feature!

6.92.6

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

If a test uses :func:`~hypothesis.strategies.sampled_from` on a sequence of
strategies, and raises a ``TypeError``, we now :pep:`add a note <678>` asking
whether you meant to use :func:`~hypothesis.strategies.one_of`.

Thanks to Vince Reuter for suggesting and implementing this hint!

Page 9 of 194

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.