Hypothesis

Latest version: v6.122.3

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

Scan your dependencies

Page 170 of 210

3.50.2

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

This has no user-visible changes except one slight formatting change to one docstring, to avoid a deprecation warning.

3.50.1

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

This patch fixes an internal error introduced in :ref:`3.48.0 <v3.48.0>`, where a check
for the Django test runner would expose import-time errors in Django
configuration (:issue:`1167`).

3.50.0

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

This release improves validation of numeric bounds for some strategies.

- :func:`~hypothesis.strategies.integers` and :func:`~hypothesis.strategies.floats`
now raise ``InvalidArgument`` if passed a ``min_value`` or ``max_value``
which is not an instance of :class:`~python:numbers.Real`, instead of
various internal errors.
- :func:`~hypothesis.strategies.floats` now converts its bounding values to
the nearest float above or below the min or max bound respectively, instead
of just casting to float. The old behaviour was incorrect in that you could
generate ``float(min_value)``, even when this was less than ``min_value``
itself (possible with eg. fractions).
- When both bounds are provided to :func:`~hypothesis.strategies.floats` but
there are no floats in the interval, such as ``[(2**54)+1 .. (2**55)-1]``,
InvalidArgument is raised.
- :func:`~hypothesis.strategies.decimals` gives a more useful error message
if passed a string that cannot be converted to :class:`~python:decimal.Decimal`
in a context where this error is not trapped.

Code that previously **seemed** to work may be explicitly broken if there
were no floats between ``min_value`` and ``max_value`` (only possible with
non-float bounds), or if a bound was not a :class:`~python:numbers.Real`
number but still allowed in :obj:`python:math.isnan` (some custom classes
with a ``__float__`` method).

3.49.1

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

This patch fixes our tests for Numpy dtype strategies on big-endian platforms,
where the strategy behaved correctly but the test assumed that the native byte
order was little-endian.

There is no user impact unless you are running our test suite on big-endian
platforms. Thanks to Graham Inggs for reporting :issue:`1164`.

3.49.0

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

This release deprecates passing ``elements=None`` to collection strategies,
such as :func:`~hypothesis.strategies.lists`.

Requiring ``lists(nothing())`` or ``builds(list)`` instead of ``lists()``
means slightly more typing, but also improves the consistency and
discoverability of our API - as well as showing how to compose or
construct strategies in ways that still work in more complex situations.

Passing a nonzero max_size to a collection strategy where the elements
strategy contains no values is now deprecated, and will be an error in a
future version. The equivalent with ``elements=None`` is already an error.

3.48.1

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

This patch will minimize examples that would come out non-minimal in previous versions. Thanks to Kyle Reeve for this patch.

Page 170 of 210

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.