Hypothesis

Latest version: v6.100.1

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

Scan your dependencies

Page 179 of 195

3.8.0

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

This is a feature release, adding the :func:`~hypothesis.strategies.iterables` strategy, equivalent
to ``lists(...).map(iter)`` but with a much more useful repr. You can use
this strategy to check that code doesn't accidentally depend on sequence
properties such as indexing support or repeated iteration.

3.7.4

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

This patch fixes a bug in :ref:`3.7.3 <v3.7.3>`, where using
:obj:`example <hypothesis.example>` and a pytest fixture in the same test
could cause the test to fail to fill the arguments, and throw a TypeError.

3.7.3

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

This release should include no user visible changes and is purely a refactoring
release. This modularises the behaviour of the core :func:`~hypothesis.given` function, breaking
it up into smaller and more accessible parts, but its actual behaviour should
remain unchanged.

3.7.2

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

This reverts an undocumented change in :ref:`3.7.1 <v3.7.1>` which broke installation on
debian stable: The specifier for the hypothesis[django] extra\_requires had
introduced a wild card, which was not supported on the default version of pip.

3.7.1

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

This is a bug fix and internal improvements release.

* In particular Hypothesis now tracks a tree of where it has already explored.
This allows it to avoid some classes of duplicate examples, and significantly
improves the performance of shrinking failing examples by allowing it to
skip some shrinks that it can determine can't possibly work.
* Hypothesis will no longer seed the global random arbitrarily unless you have
asked it to using :py:meth:`~hypothesis.strategies.random_module`
* Shrinking would previously have not worked correctly in some special cases
on Python 2, and would have resulted in suboptimal examples.

3.7.0

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

This is a feature release.

New features:

* Rule based stateful testing now has an :func:`invariant <hypothesis.stateful.invariant>` decorator that specifies
methods that are run after init and after every step, allowing you to
encode properties that should be true at all times. Thanks to Tom Prince for
this feature.
* The :func:`~hypothesis.strategies.decimals` strategy now supports ``allow_nan`` and ``allow_infinity`` flags.
* There are :ref:`significantly more strategies available for numpy <hypothesis-numpy>`, including for
generating arbitrary data types. Thanks to Zac Hatfield Dodds for this
feature.
* When using the :func:`~hypothesis.strategies.data` strategy you can now add a label as an argument to
``draw()``, which will be printed along with the value when an example fails.
Thanks to Peter Inglesby for this feature.

Bug fixes:

* Bug fix: :func:`~hypothesis.strategies.composite` now preserves functions' docstrings.
* The build is now reproducible and doesn't depend on the path you build it
from. Thanks to Chris Lamb for this feature.
* numpy strategies for the void data type did not work correctly. Thanks to
Zac Hatfield Dodds for this fix.

There have also been a number of performance optimizations:

* The :func:`~hypothesis.strategies.permutations` strategy is now significantly faster to use for large
lists (the underlying algorithm has gone from O(n^2) to O(n)).
* Shrinking of failing test cases should have got significantly faster in
some circumstances where it was previously struggling for a long time.
* Example generation now involves less indirection, which results in a small
speedup in some cases (small enough that you won't really notice it except in
pathological cases).

Page 179 of 195

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.