Hypothesis

Latest version: v6.104.0

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

Scan your dependencies

Page 186 of 198

3.1.0

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

* Add a :func:`~hypothesis.strategies.nothing` strategy that never successfully generates values.
* :func:`~hypothesis.strategies.sampled_from` and :func:`~hypothesis.strategies.one_of`
can both now be called with an empty argument
list, in which case they also never generate any values.
* :func:`~hypothesis.strategies.one_of` may now be called with a single argument that is a collection of strategies
as well as as varargs.
* Add a :func:`~hypothesis.strategies.runner` strategy which returns the instance of the current test object
if there is one.
* 'Bundle' for RuleBasedStateMachine is now a normal(ish) strategy and can be used
as such.
* Tests using RuleBasedStateMachine should now shrink significantly better.
* Hypothesis now uses a pretty-printing library internally, compatible with IPython's
pretty printing protocol (actually using the same code). This may improve the quality
of output in some cases.
* Add a 'phases' setting that allows more fine grained control over which parts of the
process Hypothesis runs
* Add a suppress_health_check setting which allows you to turn off specific health checks
in a fine grained manner.
* Fix a bug where lists of non fixed size would always draw one more element than they
included. This mostly didn't matter, but if would cause problems with empty strategies
or ones with side effects.
* Add a mechanism to the Django model generator to allow you to explicitly request the
default value (thanks to Jeremy Thurgood for this one).

3.0.5

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

* Fix a bug where Hypothesis would now error on :pypi:`pytest` development versions.

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.

Page 186 of 198

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.