Hypothesis

Latest version: v6.100.1

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

Scan your dependencies

Page 166 of 195

3.34.0

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

Hypothesis now emits deprecation warnings if you apply
:func:`given <hypothesis.given>` more than once to a target.

Applying :func:`given <hypothesis.given>` repeatedly wraps the target multiple
times. Each wrapper will search the space of of possible parameters separately.
This is equivalent but will be much more inefficient than doing it with a
single call to :func:`given <hypothesis.given>`.

For example, instead of
``given(booleans()) given(integers())``, you could write
``given(booleans(), integers())``

3.33.1

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

This is a bugfix release:

- :func:`~hypothesis.strategies.builds` would try to infer a strategy for
required positional arguments of the target from type hints, even if they
had been given to :func:`~hypothesis.strategies.builds` as positional
arguments (:issue:`946`). Now it only infers missing required arguments.
- An internal introspection function wrongly reported ``self`` as a required
argument for bound methods, which might also have affected
:func:`~hypothesis.strategies.builds`. Now it knows better.

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.

Page 166 of 195

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.