Hypothesis

Latest version: v6.100.1

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

Scan your dependencies

Page 26 of 195

6.65.0

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

Hypothesis now reports some failing inputs by showing the call which constructed
an object, rather than the repr of the object. This can be helpful when the default
repr does not include all relevant details, and will unlock further improvements
in a future version.

For now, we capture calls made via :func:`~hypothesis.strategies.builds`, and via
:ref:`SearchStrategy.map() <mapping>`.

6.64.0

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

The :doc:`Ghostwritter <ghostwriter>` will now include type annotations on tests
for type-annotated code. If you want to force this to happen (or not happen),
pass a boolean to the new ``annotate=`` argument to the Python functions, or
the ``--[no-]annotate`` CLI flag.

Thanks to Nicolas Ganz for this new feature!

6.63.0

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

:func:`~hypothesis.extra.pandas.range_indexes` now accepts a ``name=`` argument,
to generate named :class:`pandas.RangeIndex` objects.

Thanks to Sam Watts for this new feature!

6.62.1

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

This patch tweaks :func:`xps.arrays` internals to improve PyTorch compatibility.
Specifically, ``torch.full()`` does not accept integers as the shape argument
(n.b. technically "size" in torch), but such behaviour is expected in internal
code, so we copy the ``torch`` module and patch in a working ``full()`` function.

6.62.0

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

A classic error when testing is to write a test function that can never fail,
even on inputs that aren't allowed or manually provided. By analogy to the
design pattern of::

pytest.mark.parametrize("arg", [
..., passing examples
pytest.param(..., marks=[pytest.mark.xfail]) expected-failing input
])

we now support :obj:`example(...).xfail() <hypothesis.example.xfail>`, with
the same (optional) ``condition``, ``reason``, and ``raises`` arguments as
``pytest.mark.xfail()``.

Naturally you can also write ``.via(...).xfail(...)``, or ``.xfail(...).via(...)``,
if you wish to note the provenance of expected-failing examples.

6.61.3

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

This patch teaches our enhanced :func:`~typing.get_type_hints` function to
'see through' :obj:`~functools.partial` application, allowing inference
from type hints to work in a few more cases which aren't (yet!) supported
by the standard-library version.

Page 26 of 195

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.