Hypothesis

Latest version: v6.100.1

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

Scan your dependencies

Page 167 of 195

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>`.

3.31.4

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

:func:`~hypothesis.strategies.from_type` failed with a very confusing error
if passed a :obj:`~typing.NewType` (:issue:`901`). These pseudo-types
are now unwrapped correctly, and strategy inference works as expected.

3.31.3

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

This release makes some small optimisations to our use of coverage that should
reduce constant per-example overhead. This is probably only noticeable on
examples where the test itself is quite fast. On no-op tests that don't test
anything you may see up to a fourfold speed increase (which is still
significantly slower than without coverage). On more realistic tests the speed
up is likely to be less than that.

3.31.2

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

This release fixes some formatting and small typos/grammar issues in the
documentation, specifically the page docs/settings.rst, and the inline docs
for the various settings.

3.31.1

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

This release improves the handling of deadlines so that they act better with
the shrinking process. This fixes :issue:`892`.

This involves two changes:

1. The deadline is raised during the initial generation and shrinking, and then
lowered to the set value for final replay. This restricts our attention to
examples which exceed the deadline by a more significant margin, which
increases their reliability.
2. When despite the above a test still becomes flaky because it is
significantly faster on rerun than it was on its first run, the error
message is now more explicit about the nature of this problem, and includes
both the initial test run time and the new test run time.

In addition, this release also clarifies the documentation of the deadline
setting slightly to be more explicit about where it applies.

This work was funded by `Smarkets <https://smarkets.com/>`_.

Page 167 of 195

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.