Skip to content

Update hypothesis to 6.127.9#77

Closed
pyup-bot wants to merge 1 commit intomasterfrom
pyup-update-hypothesis-6.125.2-to-6.127.9
Closed

Update hypothesis to 6.127.9#77
pyup-bot wants to merge 1 commit intomasterfrom
pyup-update-hypothesis-6.125.2-to-6.127.9

Conversation

@pyup-bot
Copy link
Collaborator

@pyup-bot pyup-bot commented Mar 7, 2025

This PR updates hypothesis from 6.125.2 to 6.127.9.

Changelog

6.127.9

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

We now provide a better string representation for :func:`~hypothesis.strategies.one_of` strategies, by flattening consecutive ``|`` combinations. For instance:

.. code-block:: pycon

 >>> st.integers() | st.text() | st.booleans()
  previously: one_of(one_of(integers(), text()), booleans())
 one_of(integers(), text(), booleans())

Explicit calls to :func:`~hypothesis.strategies.one_of` remain unflattened, in order to make tracking down complicated :func:`~hypothesis.strategies.one_of` constructions easier:

.. code-block:: pycon

 >>> st.one_of(st.integers(), st.one_of(st.text(), st.booleans()))
 one_of(integers(), one_of(text(), booleans()))

We print ``one_of`` in reprs (rather than ``integers() | text() | ...``) for consistency with reprs containing ``.filter`` or ``.map`` calls, which uses the full ``one_of`` to avoid ambiguity.

6.127.8

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

This patch improves shrinking behavior for values from :func:`~hypothesis.strategies.text` and :func:`~hypothesis.strategies.binary` which contain duplicate elements, like ``"zzzabc"``. It also improves shrinking for  bugs which require the same character to be drawn from two different :func:`~hypothesis.strategies.text` strategies to trigger.

6.127.7

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

Fix a type-hinting regression from :ref:`version 6.125.1 <v6.125.1>`, where we would no longer guarantee the type of the argument to ``.filter`` predicates (:issue:`4269`).

.. code-block:: python

x was previously Unknown, but is now correctly guaranteed to be int
st.integers().filter(lambda x: x > 0)

6.127.6

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

This patch tweaks the performance of the :ref:`target phase <phases>`, avoiding aborting some test cases when it would be better to finish generating them.

6.127.5

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

This patch fixes a bug where :func:`~hypothesis.strategies.from_type` would error on certain types involving :class:`~python:typing.Protocol` (:issue:`4194`).

6.127.4

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

This patch updates our vendored `list of top-level domains <https://www.iana.org/domains/root/db>`__,
which is used by the provisional :func:`~hypothesis.provisional.domains` strategy.

6.127.3

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

Improve shrinking of non-standard NaN float values (:issue:`4277`).

6.127.2

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

Adjust type hints for the pub-sub database implementation in :ref:`version 6.126.0 <v6.126.0>`, and remove a remnant debug print in its implementation.

6.127.1

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

Improve the clarity of printing counterexamples in :doc:`stateful testing <stateful>`, by avoiding confusing :class:`~hypothesis.stateful.Bundle` references with equivalent values drawn from a regular strategy.

For example, we now print:

.. code-block:: python

a_0 = state.add_to_bundle(a=0)
state.unrelated(value=0)

instead of

.. code-block:: python

a_0 = state.add_to_bundle(a=0)
state.unrelated(value=a_0)

if the ``unrelated`` rule draws from a regular strategy such as :func:`~hypothesis.strategies.integers` instead of the ``a`` bundle.

6.127.0

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

This releases adds support for type aliases created with the :py:keyword:`type` statement (new in python 3.12) to :func:`~hypothesis.strategies.from_type` and :func:`~hypothesis.strategies.register_type_strategy`.

6.126.0

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

The :doc:`Hypothesis database <database>` now supports a pub-sub interface to efficiently listen for changes in the database, via ``.add_listener`` and ``.remove_listener``. While all databases that ship with Hypothesis support this interface, implementing it is not required for custom database subclasses. Hypothesis will warn when trying to listen on a database without support.

This feature is currently only used downstream in `hypofuzz <https://github.com/zac-hd/hypofuzz>`_.

6.125.3

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

Improves sharing of some internal cache behavior.
Links

@pyup-bot
Copy link
Collaborator Author

Closing this in favor of #83

@pyup-bot pyup-bot closed this Mar 10, 2025
@asmfreak asmfreak deleted the pyup-update-hypothesis-6.125.2-to-6.127.9 branch March 10, 2025 05:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant