Hypothesis

Latest version: v6.103.2

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

Scan your dependencies

Page 178 of 198

3.16.1

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

This release makes an implementation change to how Hypothesis handles certain
internal constructs.

The main effect you should see is improvement to the behaviour and performance
of collection types, especially ones with a ``min_size`` parameter. Many cases
that would previously fail due to being unable to generate enough valid
examples will now succeed, and other cases should run slightly faster.

3.16.0

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

This release introduces a deprecation of the timeout feature. This results in
the following changes:

* Creating a settings object with an explicit timeout will emit a deprecation
warning.
* If your test stops because it hits the timeout (and has not found a bug) then
it will emit a deprecation warning.
* There is a new value ``unlimited`` which you can import from hypothesis.
``settings(timeout=unlimited)`` will *not* cause a deprecation warning.
* There is a new health check, ``hung_test``, which will trigger after a test
has been running for five minutes if it is not suppressed.

3.15.0

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

This release deprecates two strategies, ``choices()`` and ``streaming()``.

Both of these are somewhat confusing to use and are entirely redundant since the
introduction of the :func:`~hypothesis.strategies.data` strategy for interactive
drawing in tests, and their use should be replaced with direct use of
:func:`~hypothesis.strategies.data` instead.

3.14.2

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

This fixes a bug where Hypothesis would not work correctly on Python 2.7 if you
had the :mod:`python:typing` module :pypi:`backport <typing>` installed.

3.14.1

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

This raises the maximum depth at which Hypothesis starts cutting off data
generation to a more reasonable value which it is harder to hit by accident.

This resolves (:issue:`751`), in which some examples which previously worked
would start timing out, but it will also likely improve the data generation
quality for complex data types.

3.14.0

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

Hypothesis now understands inline type annotations (:issue:`293`):

- If the target of :func:`~hypothesis.strategies.builds` has type annotations,
a default strategy for missing required arguments is selected based on the
type. Type-based strategy selection will only override a default if you
pass :const:`hypothesis.infer` as a keyword argument.

- If :func:`given <hypothesis.given>` wraps a function with type annotations,
you can pass :const:`~hypothesis.infer` as a keyword argument and the
appropriate strategy will be substituted.

- You can check what strategy will be inferred for a type with the new
:func:`~hypothesis.strategies.from_type` function.

- :func:`~hypothesis.strategies.register_type_strategy` teaches Hypothesis
which strategy to infer for custom or unknown types. You can provide a
strategy, or for more complex cases a function which takes the type and
returns a strategy.

Page 178 of 198

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.