Hypothesis

Latest version: v6.100.1

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

Scan your dependencies

Page 173 of 195

3.20.0

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

This release renames the relevant arguments on the
:func:`~hypothesis.strategies.datetimes`, :func:`~hypothesis.strategies.dates`,
:func:`~hypothesis.strategies.times`, and :func:`~hypothesis.strategies.timedeltas`
strategies to ``min_value`` and ``max_value``, to make them consistent with the
other strategies in the module.

The old argument names are still supported but will emit a deprecation warning
when used explicitly as keyword arguments. Arguments passed positionally will
go to the new argument names and are not deprecated.

3.19.3

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

This release provides a major overhaul to the internals of how Hypothesis
handles shrinking.

This should mostly be visible in terms of getting better examples for tests
which make heavy use of :func:`~hypothesis.strategies.composite`,
:func:`~hypothesis.strategies.data` or :ref:`flatmap <flatmap>` where the data
drawn depends a lot on previous choices, especially where size parameters are
affected. Previously Hypothesis would have struggled to reliably produce
good examples here. Now it should do much better. Performance should also be
better for examples with a non-zero ``min_size``.

You may see slight changes to example generation (e.g. improved example
diversity) as a result of related changes to internals, but they are unlikely
to be significant enough to notice.

3.19.2

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

This release fixes two bugs in :mod:`hypothesis.extra.numpy`:

* :func:`~hypothesis.extra.numpy.unicode_string_dtypes` didn't work at all due
to an incorrect dtype specifier. Now it does.
* Various impossible conditions would have been accepted but would error when
they fail to produced any example. Now they raise an explicit InvalidArgument
error.

3.19.1

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

This is a bugfix release for :issue:`739`, where bounds for
:func:`~hypothesis.strategies.fractions` or floating-point
:func:`~hypothesis.strategies.decimals` were not properly converted to
integers before passing them to the integers strategy.
This excluded some values that should have been possible, and could
trigger internal errors if the bounds lay between adjacent integers.

You can now bound :func:`~hypothesis.strategies.fractions` with two
arbitrarily close fractions.

It is now an explicit error to supply a min_value, max_value, and
max_denominator to :func:`~hypothesis.strategies.fractions` where the value
bounds do not include a fraction with denominator at most max_denominator.

3.19.0

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

This release adds the :func:`~hypothesis.strategies.from_regex` strategy,
which generates strings that contain a match of a regular expression.

Thanks to Maxim Kulkin for creating the
`hypothesis-regex <https://github.com/maximkulkin/hypothesis-regex>`_
package and then helping to upstream it! (:issue:`662`)

3.18.5

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

This is a bugfix release for :func:`~hypothesis.strategies.integers`.
Previously the strategy would hit an internal assertion if passed non-integer
bounds for ``min_value`` and ``max_value`` that had no integers between them.
The strategy now raises InvalidArgument instead.

Page 173 of 195

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.