Hypothesis

Latest version: v6.122.3

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

Scan your dependencies

Page 202 of 210

1.10.3

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

Another small bug fix release.

* lists(elements, unique_by=some_function, min_size=n) would have raised a
ValidationError if n > Settings.default.average_list_length because it would
have wanted to use an average list length shorter than the minimum size of
the list, which is impossible. Now it instead defaults to twice the minimum
size in these circumstances.
* basic() strategy would have only ever produced at most ten distinct values
per run of the test (which is bad if you e.g. have it inside a list). This
was obviously silly. It will now produce a much better distribution of data,
both duplicated and non duplicated.

1.10.2

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

This is a small bug fix release:

* star imports from hypothesis should now work correctly.
* example quality for examples using flatmap will be better, as the way it had
previously been implemented was causing problems where Hypothesis was
erroneously labelling some examples as being duplicates.

1.10.0

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

This is just a bugfix and performance release, but it changes some
semi-public APIs, hence the minor version bump.

* Significant performance improvements for strategies which are one\_of()
many branches. In particular this included recursive() strategies. This
should take the case where you use one recursive() strategy as the base
strategy of another from unusably slow (tens of seconds per generated
example) to reasonably fast.
* Better handling of just() and sampled_from() for values which have an
incorrect \_\_repr\_\_ implementation that returns non-ASCII unicode
on Python 2.
* Better performance for flatmap from changing the internal morpher API
to be significantly less general purpose.
* Introduce a new semi-public BuildContext/cleanup API. This allows
strategies to register cleanup activities that should run once the
example is complete. Note that this will interact somewhat weirdly with
find.
* Better simplification behaviour for streaming strategies.
* Don't error on lambdas which use destructuring arguments in Python 2.
* Add some better reprs for a few strategies that were missing good ones.
* The Random instances provided by randoms() are now copyable.
* Slightly more debugging information about simplify when using a debug
verbosity level.
* Support using given for functions with varargs, but not passing arguments
to it as positional.

1.9.0

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

Codename: The great bundling.

This release contains two fairly major changes.

The first is the deprecation of the hypothesis-extra mechanism. From
now on all the packages that were previously bundled under it other
than hypothesis-pytest (which is a different beast and will remain
separate). The functionality remains unchanged and you can still import
them from exactly the same location, they just are no longer separate
packages.

The second is that this introduces a new way of building strategies
which lets you build up strategies recursively from other strategies.

It also contains the minor change that calling .example() on a
strategy object will give you examples that are more representative of
the actual data you'll get. There used to be some logic in there to make
the examples artificially simple but this proved to be a bad idea.

1.8.5

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

This contains no functionality changes but fixes a mistake made with
building the previous package that would have broken installation on
Windows.

1.8.4

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

Bugs fixed:

* When a call to floats() had endpoints which were not floats but merely
convertible to one (e.g. integers), these would be included in the generated
data which would cause it to generate non-floats.
* Splitting lambdas used in the definition of flatmap, map or filter over
multiple lines would break the repr, which would in turn break their usage.

Page 202 of 210

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.