Hypothesis

Latest version: v6.122.3

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

Scan your dependencies

Page 71 of 210

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

Page 71 of 210

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.