Hypothesis

Latest version: v6.122.3

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

Scan your dependencies

Page 200 of 210

1.16.0

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

There are no public API changes in this release but it includes a behaviour
change that I wasn't comfortable putting in a patch release.

* Functions from hypothesis.strategies will no longer raise InvalidArgument
on bad arguments. Instead the same errors will be raised when a test
using such a strategy is run. This may improve startup time in some
cases, but the main reason for it is so that errors in strategies
won't cause errors in loading, and it can interact correctly with things
like pytest.mark.skipif.
* Errors caused by accidentally invoking the legacy API are now much less
confusing, although still throw NotImplementedError.
* hypothesis.extra.django is 1.9 compatible.
* When tests are run with max_shrinks=0 this will now still rerun the test
on failure and will no longer print "Trying example:" before each run.
Additionally note() will now work correctly when used with max_shrinks=0.

1.15.0

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

A release with two new features.

* A 'characters' strategy for more flexible generation of text with particular
character ranges and types, kindly contributed by `Alexander Shorin <https://github.com/kxepal>`_.
* Add support for preconditions to the rule based stateful testing. Kindly
contributed by `Christopher Armstrong <https://github.com/radix>`_

1.14.0

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


New features:

* Add 'note' function which lets you include additional information in the
final test run's output.
* Add 'choices' strategy which gives you a choice function that emulates
random.choice.
* Add 'uuid' strategy that generates UUIDs'
* Add 'shared' strategy that lets you create a strategy that just generates a
single shared value for each test run

Bugs:

* Using strategies of the form streaming(x.flatmap(f)) with find or in stateful
testing would have caused InvalidArgument errors when the resulting values
were used (because code that expected to only be called within a test context
would be invoked).

1.13.0

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

This is quite a small release, but deprecates some public API functions
and removes some internal API functionality so gets a minor version bump.

* All calls to the 'strategy' function are now deprecated, even ones which
pass just a SearchStrategy instance (which is still a no-op).
* Never documented hypothesis.extra entry_points mechanism has now been removed (
it was previously how hypothesis.extra packages were loaded and has been deprecated
and unused for some time)
* Some corner cases that could previously have produced an OverflowError when simplifying
failing cases using hypothesis.extra.datetimes (or dates or times) have now been fixed.
* Hypothesis load time for first import has been significantly reduced - it used to be
around 250ms (on my SSD laptop) and now is around 100-150ms. This almost never
matters but was slightly annoying when using it in the console.
* hypothesis.strategies.randoms was previously missing from \_\_all\_\_.

1.12.0

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

* Significantly improved performance of creating strategies using the functions
from the hypothesis.strategies module by deferring the calculation of their
repr until it was needed. This is unlikely to have been an performance issue
for you unless you were using flatmap, composite or stateful testing, but for
some cases it could be quite a significant impact.
* A number of cases where the repr of strategies build from lambdas is improved
* Add dates() and times() strategies to hypothesis.extra.datetimes
* Add new 'profiles' mechanism to the settings system
* Deprecates mutability of Settings, both the Settings.default top level property
and individual settings.
* A Settings object may now be directly initialized from a parent Settings.
* given should now give a better error message if you attempt to use it with a
function that uses destructuring arguments (it still won't work, but it will
error more clearly),
* A number of spelling corrections in error messages
* :pypi:`pytest` should no longer display the intermediate modules Hypothesis generates
when running in verbose mode
* Hypothesis should now correctly handle printing objects with non-ascii reprs
on python 3 when running in a locale that cannot handle ascii printing to
stdout.
* Add a unique=True argument to lists(). This is equivalent to
unique_by=lambda x: x, but offers a more convenient syntax.

1.11.4

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

* Hide modifications Hypothesis needs to make to sys.path by undoing them
after we've imported the relevant modules. This is a workaround for issues
cryptography experienced on windows.
* Slightly improved performance of drawing from sampled_from on large lists
of alternatives.
* Significantly improved performance of drawing from one_of or strategies
using \| (note this includes a lot of strategies internally - floats()
and integers() both fall into this category). There turned out to be a
massive performance regression introduced in 1.10.0 affecting these which
probably would have made tests using Hypothesis significantly slower than
they should have been.

Page 200 of 210

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.