Hypothesis

Latest version: v6.100.1

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

Scan your dependencies

Page 185 of 195

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.

1.11.3

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

* Better argument validation for datetimes() strategy - previously setting
max_year < datetime.MIN_YEAR or min_year > datetime.MAX_YEAR would not have
raised an InvalidArgument error and instead would have behaved confusingly.
* Compatibility with being run on pytest < 2.7 (achieved by disabling the
plugin).

1.11.2

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

Bug fixes:

* Settings(database=my_db) would not be correctly inherited when used as a
default setting, so that newly created settings would use the database_file
setting and create an SQLite example database.
* Settings.default.database = my_db would previously have raised an error and
now works.
* Timeout could sometimes be significantly exceeded if during simplification
there were a lot of examples tried that didn't trigger the bug.
* When loading a heavily simplified example using a basic() strategy from the
database this could cause Python to trigger a recursion error.
* Remove use of deprecated API in pytest plugin so as to not emit warning

Misc:

* hypothesis-pytest is now part of hypothesis core. This should have no
externally visible consequences, but you should update your dependencies to
remove hypothesis-pytest and depend on only Hypothesis.
* Better repr for hypothesis.extra.datetimes() strategies.
* Add .close() method to abstract base class for Backend (it was already present
in the main implementation).

Page 185 of 195

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.