Hypothesis

Latest version: v6.103.0

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

Scan your dependencies

Page 169 of 197

3.33.0

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

This release supports strategy inference for more Django field types - you can now omit an argument for
Date, Time, Duration, Slug, IP Address, and UUID fields. (:issue:`642`)

Strategy generation for fields with grouped choices now selects choices from
each group, instead of selecting from the group names.

3.32.2

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

This patch removes the ``mergedb`` tool, introduced in Hypothesis 1.7.1
on an experimental basis. It has never actually worked, and the new
:doc:`Hypothesis example database <database>` is designed to make such a
tool unnecessary.

3.32.1

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

This patch has two improvements for strategies based on enumerations.

- :func:`~hypothesis.strategies.from_type` now handles enumerations correctly,
delegating to :func:`~hypothesis.strategies.sampled_from`. Previously it
noted that ``Enum.__init__`` has no required arguments and therefore delegated
to :func:`~hypothesis.strategies.builds`, which would subsequently fail.
- When sampling from an :class:`python:enum.Flag`, we also generate combinations
of members. Eg for ``Flag('Permissions', 'READ, WRITE, EXECUTE')`` we can now
generate, ``Permissions.READ``, ``Permissions.READ|WRITE``, and so on.

3.32.0

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

This changes the default value of
the ``use_coverage`` setting to True when
running on pypy (it was already True on CPython).

It was previously set to False because we expected it to be too slow, but
recent benchmarking shows that actually performance of the feature on pypy is
fairly acceptable - sometimes it's slower than on CPython, sometimes it's
faster, but it's generally within a factor of two either way.

3.31.6

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

This patch improves the quality of strategies inferred from Numpy dtypes:

* Integer dtypes generated examples with the upper half of their (non-sign) bits
set to zero. The inferred strategies can now produce any representable integer.
* Fixed-width unicode- and byte-string dtypes now cap the internal example
length, which should improve example and shrink quality.
* Numpy arrays can only store fixed-size strings internally, and allow shorter
strings by right-padding them with null bytes. Inferred string strategies
no longer generate such values, as they can never be retrieved from an array.
This improves shrinking performance by skipping useless values.

This has already been useful in Hypothesis - we found an overflow bug in our
Pandas support, and as a result :func:`~hypothesis.extra.pandas.indexes` and
:func:`~hypothesis.extra.pandas.range_indexes` now check that ``min_size``
and ``max_size`` are at least zero.

3.31.5

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

This release fixes a performance problem in tests where
the ``use_coverage`` setting is True.

Tests experience a slow-down proportionate to the amount of code they cover.
This is still the case, but the factor is now low enough that it should be
unnoticeable. Previously it was large and became much larger in :ref:`3.30.4 <v3.30.4>`.

Page 169 of 197

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.