Hypothesis

Latest version: v6.122.3

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

Scan your dependencies

Page 199 of 210

1.19.0

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

Codename: IT COMES

This release heralds the beginning of a new and terrible age of Hypothesis 2.0.

It's primary purpose is some final deprecations prior to said release. The goal
is that if your code emits no warnings under this release then it will probably run
unchanged under Hypothesis 2.0 (there are some caveats to this: 2.0 will drop
support for some Python versions, and if you're using internal APIs then as usual
that may break without warning).

It does have two new features:

* New seed() decorator which allows you to manually seed a test. This may be
harmlessly combined with and overrides the derandomize setting.
* settings objects may now be used as a decorator to fix those settings to a
particular given test.

API changes (old usage still works but is deprecated):

* Settings has been renamed to settings (lower casing) in order to make the
decorator usage more natural.
* Functions for the storage directory that were in hypothesis.settings are now
in a new hypothesis.configuration module.

Additional deprecations:

* the average_list_length setting has been deprecated in favour of being
explicit.
* the basic() strategy has been deprecated as it is impossible to support
it under a Conjecture based model, which will hopefully be implemented at
some point in the 2.x series.
* the n_ary_tree strategy (which was never actually part of the public API)
has been deprecated.
* Passing settings or random as keyword arguments to given is deprecated (use
the new functionality instead)


Bug fixes:

* No longer emit PendingDeprecationWarning for __iter__ and StopIteration in
streaming() values.
* When running in health check mode with non strict, don't print quite so
many errors for an exception in reify.
* When an assumption made in a test or a filter is flaky, tests will now
raise Flaky instead of UnsatisfiedAssumption.

1.18.1

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

Two behind the scenes changes:

* Hypothesis will no longer write generated code to the file system. This
will improve performance on some systems (e.g. if you're using
`PythonAnywhere <https://www.pythonanywhere.com/>`_ which is running your
code from NFS) and prevent some annoying interactions with auto-restarting
systems.
* Hypothesis will cache the creation of some strategies. This can significantly
improve performance for code that uses flatmap or composite and thus has to
instantiate strategies a lot.

1.18.0

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

Features:

* Tests and find are now explicitly seeded off the global random module. This
means that if you nest one inside the other you will now get a health check
error. It also means that you can control global randomization by seeding
random.
* There is a new random_module() strategy which seeds the global random module
for you and handles things so that you don't get a health check warning if
you use it inside your tests.
* floats() now accepts two new arguments: allow\_nan and allow\_infinity. These
default to the old behaviour, but when set to False will do what the names
suggest.

Bug fixes:

* Fix a bug where tests that used text() on Python 3.4+ would not actually be
deterministic even when explicitly seeded or using the derandomize mode,
because generation depended on dictionary iteration order which was affected
by hash randomization.
* Fix a bug where with complicated strategies the timing of the initial health
check could affect the seeding of the subsequent test, which would also
render supposedly deterministic tests non-deterministic in some scenarios.
* In some circumstances flatmap() could get confused by two structurally
similar things it could generate and would produce a flaky test where the
first time it produced an error but the second time it produced the other
value, which was not an error. The same bug was presumably also possible in
composite().
* flatmap() and composite() initial generation should now be moderately faster.
This will be particularly noticeable when you have many values drawn from the
same strategy in a single run, e.g. constructs like lists(s.flatmap(f)).
Shrinking performance *may* have suffered, but this didn't actually produce
an interestingly worse result in any of the standard scenarios tested.

1.17.1

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

A small bug fix release, which fixes the fact that the 'note' function could
not be used on tests which used the example decorator to provide explicit
examples.

1.17.0

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

This is actually the same release as 1.16.1, but 1.16.1 has been pulled because
it contains the following additional change that was not intended to be in a
patch release (it's perfectly stable, but is a larger change that should have
required a minor version bump):

* Hypothesis will now perform a series of "health checks" as part of running
your tests. These detect and warn about some common error conditions that
people often run into which wouldn't necessarily have caused the test to fail
but would cause e.g. degraded performance or confusing results.

1.16.1

-------------------

Note: This release has been removed.

A small bugfix release that allows bdists for Hypothesis to be built
under 2.7 - the compat3.py file which had Python 3 syntax wasn't intended
to be loaded under Python 2, but when building a bdist it was. In particular
this would break running setup.py test.

Page 199 of 210

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.