Hypothesis

Latest version: v6.122.3

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

Scan your dependencies

Page 60 of 210

6.30.0

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

This release adds an ``allow_subnormal`` argument to the
:func:`~hypothesis.strategies.floats` strategy, which can explicitly toggle the
generation of :wikipedia:`subnormal floats <Subnormal_number>` (:issue:`3155`).
Disabling such generation is useful when testing flush-to-zero builds of
libraries.

:func:`nps.from_dtype() <hypothesis.extra.numpy.from_dtype>` and
:func:`xps.from_dtype` can also accept the ``allow_subnormal`` argument, and
:func:`xps.from_dtype` or :func:`xps.arrays` will disable subnormals by default
if the array module ``xp`` is detected to flush-to-zero (like is typical with
CuPy).

6.29.3

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

This patch fixes a bug in :func:`~hypothesis.extra.numpy.mutually_broadcastable_shapes`,
which restricted the patterns of singleton dimensions that could be generated for
dimensions that extended beyond ``base_shape`` (:issue:`3170`).

6.29.2

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

This patch clarifies our pretty-printing of DataFrames (:issue:`3114`).

6.29.1

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

This patch documents :func:`~hypothesis.strategies.timezones`
`Windows-only requirement <https://docs.python.org/3/library/zoneinfo.html#data-sources>`__
for the :pypi:`tzdata` package, and ensures that
``pip install hypothesis[zoneinfo]`` will install the latest version.

6.29.0

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

This release teaches :func:`~hypothesis.strategies.builds` to use
:func:`~hypothesis.strategies.deferred` when resolving unrecognised type hints,
so that you can conveniently register strategies for recursive types
with constraints on some arguments (:issue:`3026`):

.. code-block:: python

class RecursiveClass:
def __init__(self, value: int, next_node: typing.Optional["SomeClass"]):
assert value > 0
self.value = value
self.next_node = next_node


st.register_type_strategy(
RecursiveClass, st.builds(RecursiveClass, value=st.integers(min_value=1))
)

6.28.1

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

This release fixes some internal calculations related to collection sizes (:issue:`3143`).

Page 60 of 210

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.