Hypothesis

Latest version: v6.122.3

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

Scan your dependencies

Page 198 of 210

3.0.4

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

* Fix a bug where Hypothesis would error when running on Python 2.7.3 or
earlier because it was trying to pass a :class:`python:bytearray` object
to :func:`python:struct.unpack` (which is only supported since 2.7.4).

3.0.3

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

* Fix version parsing of pytest to work with pytest release candidates
* More general handling of the health check problem where things could fail because
of a cache miss - now one "free" example is generated before the start of the
health check run.

3.0.2

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

* Under certain circumstances, strategies involving :func:`~hypothesis.strategies.text` buried inside some
other strategy (e.g. ``text().filter(...)`` or ``recursive(text(), ...))`` would cause
a test to fail its health checks the first time it ran. This was caused by having
to compute some related data and cache it to disk. On travis or anywhere else
where the ``.hypothesis`` directory was recreated this would have caused the tests
to fail their health check on every run. This is now fixed for all the known cases,
although there could be others lurking.

3.0.1

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

* Fix a case where it was possible to trigger an "Unreachable" assertion when
running certain flaky stateful tests.
* Improve shrinking of large stateful tests by eliminating a case where it was
hard to delete early steps.
* Improve efficiency of drawing :func:`binary(min_size=n, max_size=n) <hypothesis.strategies.binary>` significantly by
provide a custom implementation for fixed size blocks that can bypass a lot
of machinery.
* Set default home directory based on the current working directory at the
point Hypothesis is imported, not whenever the function first happens to be
called.

3.0.0

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

Codename: This really should have been 2.1.

Externally this looks like a very small release. It has one small breaking change
that probably doesn't affect anyone at all (some behaviour that never really worked
correctly is now outright forbidden) but necessitated a major version bump and one
visible new feature.

Internally this is a complete rewrite. Almost nothing other than the public API is
the same.

New features:

* Addition of :func:`~hypothesis.strategies.data` strategy which allows you to draw arbitrary data interactively
within the test.
* New "exploded" database format which allows you to more easily check the example
database into a source repository while supporting merging.
* Better management of how examples are saved in the database.
* Health checks will now raise as errors when they fail. It was too easy to have
the warnings be swallowed entirely.

New limitations:

* ``choices()`` and ``streaming()``
strategies may no longer be used with ``find()``. Neither may
:func:`~hypothesis.strategies.data` (this is the change that necessitated a major version bump).

Feature removal:

* The ForkingTestCase executor has gone away. It may return in some more working
form at a later date.

Performance improvements:

* A new model which allows flatmap, composite strategies and stateful testing to
perform *much* better. They should also be more reliable.
* Filtering may in some circumstances have improved significantly. This will
help especially in cases where you have lots of values with individual filters
on them, such as lists(x.filter(...)).
* Modest performance improvements to the general test runner by avoiding expensive
operations

In general your tests should have got faster. If they've instead got significantly
slower, I'm interested in hearing about it.

Data distribution:

The data distribution should have changed significantly. This may uncover bugs the
previous version missed. It may also miss bugs the previous version could have
uncovered. Hypothesis is now producing less strongly correlated data than it used
to, but the correlations are extended over more of the structure.

Shrinking:

Shrinking quality should have improved. In particular Hypothesis can now perform
simultaneous shrinking of separate examples within a single test (previously it
was only able to do this for elements of a single collection). In some cases
performance will have improved, in some cases it will have got worse but generally
shouldn't have by much.


Older versions
==============

2.0.0

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

Codename: A new beginning

This release cleans up all of the legacy that accrued in the course of
Hypothesis 1.0. These are mostly things that were emitting deprecation warnings
in 1.19.0, but there were a few additional changes.

In particular:

* non-strategy values will no longer be converted to strategies when used in
given or find.
* FailedHealthCheck is now an error and not a warning.
* Handling of non-ascii reprs in user types have been simplified by using raw
strings in more places in Python 2.
* given no longer allows mixing positional and keyword arguments.
* given no longer works with functions with defaults.
* given no longer turns provided arguments into defaults - they will not appear
in the argspec at all.
* the basic() strategy no longer exists.
* the n_ary_tree strategy no longer exists.
* the average_list_length setting no longer exists. Note: If you're using
using recursive() this will cause you a significant slow down. You should
pass explicit average_size parameters to collections in recursive calls.
* rule can no longer be applied to the same method twice.
* Python 2.6 and 3.3 are no longer officially supported, although in practice
they still work fine.

This also includes two non-deprecation changes:

* given's keyword arguments no longer have to be the rightmost arguments and
can appear anywhere in the method signature.
* The max_shrinks setting would sometimes not have been respected.

Page 198 of 210

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.