Hypothesis

Latest version: v6.100.1

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

Scan your dependencies

Page 180 of 195

3.6.1

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

This release fixes a dependency problem and makes some small behind the scenes
improvements.

* The fake-factory dependency was renamed to faker. If you were depending on
it through hypothesis[django] or hypothesis[fake-factory] without pinning it
yourself then it would have failed to install properly. This release changes
it so that hypothesis[fakefactory] (which can now also be installed as
hypothesis[faker]) will install the renamed faker package instead.
* This release also removed the dependency of hypothesis[django] on
hypothesis[fakefactory] - it was only being used for emails. These now use
a custom strategy that isn't from fakefactory. As a result you should also
see performance improvements of tests which generated User objects or other
things with email fields, as well as better shrinking of email addresses.
* The distribution of code using nested calls to :func:`~hypothesis.strategies.one_of` or the ``|`` operator for
combining strategies has been improved, as branches are now flattened to give
a more uniform distribution.
* Examples using :func:`~hypothesis.strategies.composite` or ``.flatmap`` should now shrink better. In particular
this will affect things which work by first generating a length and then
generating that many items, which have historically not shrunk very well.

3.6.0

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

This release reverts Hypothesis to its old pretty printing of lambda functions
based on attempting to extract the source code rather than decompile the bytecode.
This is unfortunately slightly inferior in some cases and may result in you
occasionally seeing things like ``lambda x: <unknown>`` in statistics reports and
strategy reprs.

This removes the dependencies on uncompyle6, xdis and spark-parser.

The reason for this is that the new functionality was based on uncompyle6, which
turns out to introduce a hidden GPLed dependency - it in turn depended on xdis,
and although the library was licensed under the MIT license, it contained some
GPL licensed source code and thus should have been released under the GPL.

My interpretation is that Hypothesis itself was never in violation of the GPL
(because the license it is under, the Mozilla Public License v2, is fully
compatible with being included in a GPL licensed work), but I have not consulted
a lawyer on the subject. Regardless of the answer to this question, adding a
GPLed dependency will likely cause a lot of users of Hypothesis to inadvertently
be in violation of the GPL.

As a result, if you are running Hypothesis 3.5.x you really should upgrade to
this release immediately.

3.5.3

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

This is a bug fix release.

Bugs fixed:

* If the same test was running concurrently in two processes and there were
examples already in the test database which no longer failed, Hypothesis
would sometimes fail with a FileNotFoundError (IOError on Python 2) because
an example it was trying to read was deleted before it was read. (:issue:`372`).
* Drawing from an :func:`~hypothesis.strategies.integers` strategy with both a min_value and a max_value
would reject too many examples needlessly. Now it repeatedly redraws until
satisfied. (:pull:`366`. Thanks to Calen Pennington for the contribution).

3.5.2

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

This is a bug fix release.

* The Hypothesis pytest plugin broke pytest support for doctests. Now it doesn't.

3.5.1

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

This is a bug fix release.

* Hypothesis now runs cleanly in -B and -BB modes, avoiding mixing bytes and unicode.
* :class:`python:unittest.TestCase` tests would not have shown up in the new statistics mode. Now they
do.
* Similarly, stateful tests would not have shown up in statistics and now they do.
* Statistics now print with pytest node IDs (the names you'd get in pytest verbose mode).

3.5.0

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

This is a feature release.

* :func:`~hypothesis.strategies.fractions` and :func:`~hypothesis.strategies.decimals` strategies now support min_value and max_value
parameters. Thanks go to Anne Mulhern for the development of this feature.
* The Hypothesis pytest plugin now supports a ``--hypothesis-show-statistics`` parameter
that gives detailed statistics about the tests that were run. Huge thanks to
Jean-Louis Fuchs and Adfinis-SyGroup for funding the development of this feature.
* There is a new :func:`~hypothesis.event` function that can be used to add custom statistics.

Additionally there have been some minor bug fixes:

* In some cases Hypothesis should produce fewer duplicate examples (this will mostly
only affect cases with a single parameter).
* :pypi:`pytest` command line parameters are now under an option group for Hypothesis (thanks
to David Keijser for fixing this)
* Hypothesis would previously error if you used :pep:`3107` function annotations on your tests under
Python 3.4.
* The repr of many strategies using lambdas has been improved to include the lambda body
(this was previously supported in many but not all cases).

Page 180 of 195

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.