Hypothesis

Latest version: v6.100.1

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

Scan your dependencies

Page 146 of 195

3.66.6

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

This patch ensures that Hypothesis fully supports Python 3.7, by
upgrading :func:`~hypothesis.strategies.from_type` (:issue:`1264`)
and fixing some minor issues in our test suite (:issue:`1148`).

3.66.5

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

This patch fixes the online docs for various extras, by ensuring that
their dependencies are installed on readthedocs.io (:issue:`1326`).

3.66.4

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

This release improves the shrinker's ability to reorder examples.

For example, consider the following test:

.. code-block:: python

import hypothesis.strategies as st
from hypothesis import given


given(st.text(), st.text())
def test_non_equal(x, y):
assert x != y

Previously this could have failed with either of ``x="", y="0"`` or
``x="0", y=""``. Now it should always fail with ``x="", y="0"``.

This will allow the shrinker to produce more consistent results, especially in
cases where test cases contain some ordered collection whose actual order does
not matter.

3.66.3

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

This patch fixes inference in the :func:`~hypothesis.strategies.builds`
strategy with subtypes of :class:`python:typing.NamedTuple`, where the
``__init__`` method is not useful for introspection. We now use the
field types instead - thanks to James Uther for identifying this bug.

3.66.2

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

This release improves the shrinker's ability to handle situations where there
is an additive constraint between two values.

For example, consider the following test:


.. code-block:: python

import hypothesis.strategies as st
from hypothesis import given


given(st.integers(), st.integers())
def test_does_not_exceed_100(m, n):
assert m + n < 100

Previously this could have failed with almost any pair ``(m, n)`` with
``0 <= m <= n`` and ``m + n == 100``. Now it should almost always fail with
``m=0, n=100``.

This is a relatively niche specialisation, but can be useful in situations
where e.g. a bug is triggered by an integer overflow.

3.66.1

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

This patch fixes a rare bug where an incorrect percentage drawtime
could be displayed for a test, when the system clock was changed during
a test running under Python 2 (we use :func:`python:time.monotonic`
where it is available to avoid such problems). It also fixes a possible
zero-division error that can occur when the underlying C library
double-rounds an intermediate value in :func:`python:math.fsum` and
gets the least significant bit wrong.

Page 146 of 195

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.