Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update hypothesis to 6.88.3 #1129

Closed
wants to merge 1 commit into from

Conversation

pyup-bot
Copy link
Collaborator

@pyup-bot pyup-bot commented Nov 5, 2023

This PR updates hypothesis from 6.68.0 to 6.88.3.

Changelog

6.88.3

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

This patch refactors ``from_type(typing.Tuple)``, allowing
:func:`~hypothesis.strategies.register_type_strategy` to take effect
for tuples instead of being silently ignored (:issue:`3750`).

Thanks to Nick Collins for reporting and extensive work on this issue.

6.88.2

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

This patch improves the speed of the explain phase on python 3.12+, by using the new
:mod:`sys.monitoring` module to collect coverage, instead of :obj:`sys.settrace`.

Thanks to Liam DeVoe for :pull:`3776`!

6.88.1

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

This patch improves :func:`~hypothesis.strategies.register_type_strategy` when used with ``tuple`` subclasses,
by preventing them from being interpreted as generic and provided to strategies like ``st.from_type(Sequence[int])``
(:issue:`3767`).

6.88.0

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

This release allows strategy-generating functions registered with
:func:`~hypothesis.strategies.register_type_strategy` to conditionally not
return a strategy, by returning :data:`NotImplemented` (:issue:`3767`).

6.87.4

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

When :func:`~hypothesis.strategies.randoms` was called with ``use_true_randoms=False``,
calling ``r.sample([], 0)`` would result in an error,
when it should have returned an empty sequence to agree with the normal behaviour of
:func:`random.sample`. This fixes that discrepancy (:issue:`3765`).

6.87.3

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

This patch ensures that the :ref:`hypothesis codemod <codemods>` CLI
will print a warning instead of stopping with an internal error if
one of your files contains invalid syntax (:issue:`3759`).

6.87.2

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

This patch makes some small changes to our NumPy integration to ensure forward
compatibility.  Thanks to Mateusz Sokół for :pull:`3761`.

6.87.1

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

Fixes :issue:`3755`, where an internal condition turns out
to be reachable after all.

6.87.0

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

This release deprecates use of :func:`~hypothesis.assume` and ``reject()``
outside of property-based tests, because these functions work by raising a
special exception (:issue:`3743`).  It also fixes some type annotations
(:issue:`3753`).

6.86.2

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

Hotfix for :issue:`3747`, a bug in explain mode which is so rare that
we missed it in six months of dogfooding.  Thanks to :pypi:`mygrad`
for discovering and promptly reporting this!

6.86.1

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

This patch improves the documentation of :obj:`example(...).xfail() <hypothesis.example.xfail>`
by adding a note about :pep:`614`, similar to :obj:`example(...).via() <hypothesis.example.via>`,
and adds a warning when a strategy generates a test case which seems identical to
one provided by an xfailed example.

6.86.0

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

This release enables the :obj:`~hypothesis.Phase.explain` :ref:`phase <phases>`
by default.  We hope it helps you to understand *why* your failing tests have
failed!

6.85.1

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

This patch switches some of our type annotations to use :obj:`typing.Literal`
when only a few specific values are allowed, such as UUID or IP address versions.

6.85.0

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

This release deprecates the old whitelist/blacklist arguments
to :func:`~hypothesis.strategies.characters`, in favor of
include/exclude arguments which more clearly describe their
effects on the set of characters which can be generated.

You can :ref:`use Hypothesis' codemods <codemods>` to automatically
upgrade to the new argument names.  In a future version, the old
names will start to raise a ``DeprecationWarning``.

6.84.3

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

This patch automatically disables the :obj:`~hypothesis.HealthCheck.differing_executors`
health check for methods which are also pytest parametrized tests, because
those were mostly false alarms (:issue:`3733`).

6.84.2

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

Building on recent releases, :func:`~hypothesis.strategies.characters`
now accepts _any_ ``codec=``, not just ``"utf-8"`` and ``"ascii"``.

This includes standard codecs from the :mod:`codecs` module and their
aliases, platform specific and user-registered codecs if they are
available, and `python-specific text encodings
<https://docs.python.org/3/library/codecs.html#python-specific-encodings>`__
(but not text transforms or binary transforms).

6.84.1

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

This patch by Reagan Lee makes ``st.text(...).filter(str.isidentifier)``
return an efficient custom strategy (:issue:`3480`).

6.84.0

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

The :func:`~hypothesis.strategies.from_regex` strategy now takes an optional
``alphabet=characters(codec="utf-8")`` argument for unicode strings, like
:func:`~hypothesis.strategies.text`.

This offers more and more-consistent control over the generated strings,
removing previously-hard-coded limitations.  With ``fullmatch=False`` and
``alphabet=characters()``, surrogate characters are now possible in leading
and trailing text as well as the body of the match.  Negated character classes
such as ``[^A-Z]`` or ``\S`` had a hard-coded exclusion of control characters
and surrogate characters; now they permit anything in ``alphabet=`` consistent
with the class, and control characters are permitted by default.

6.83.2

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

Add a health check that detects if the same test is executed
several times by :ref:`different executors<custom-function-execution>`.
This can lead to difficult-to-debug problems such as :issue:`3446`.

6.83.1

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

Pretty-printing of failing examples can now use functions registered with
:func:`IPython.lib.pretty.for_type` or :func:`~IPython.lib.pretty.for_type_by_name`,
as well as restoring compatibility with ``_repr_pretty_`` callback methods
which were accidentally broken in :ref:`version 6.61.2 <v6.61.2>` (:issue:`3721`).

6.83.0

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

Adds a new ``codec=`` option in :func:`~hypothesis.strategies.characters`, making it
convenient to produce only characters which can be encoded as ``ascii`` or ``utf-8``
bytestrings.

Support for other codecs will be added in a future release.

6.82.7

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

This patch updates our autoformatting tools, improving our code style without any API changes.

6.82.6

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

This patch enables and fixes many more of :pypi:`ruff`\ 's lint rules.

6.82.5

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

Fixes the error message for missing ``[cli]`` extra.

6.82.4

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

This patch ensures that we always close the download connection in
:class:`~hypothesis.database.GitHubArtifactDatabase`.

6.82.3

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

We can now pretty-print combinations of *zero* :class:`enum.Flag`
values, like ``SomeFlag(0)``, which has never worked before.

6.82.2

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

This patch fixes pretty-printing of combinations of :class:`enum.Flag`
values, which was previously an error (:issue:`3709`).

6.82.1

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

Improve shrinking of floats in narrow regions that don't cross an integer
boundary. Closes :issue:`3357`.

6.82.0

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

:func:`~hypothesis.strategies.from_regex` now supports the atomic grouping
(``(?>...)``) and possessive quantifier (``*+``, ``++``, ``?+``, ``{m,n}+``)
syntax `added in Python 3.11 <https://docs.python.org/3/whatsnew/3.11.html#re>`__.

Thanks to Cheuk Ting Ho for implementing this!

6.81.2

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

If the :envvar:`HYPOTHESIS_NO_PLUGINS` environment variable is set, we'll avoid
:ref:`loading plugins <entry-points>` such as `the old Pydantic integration
<https://docs.pydantic.dev/latest/integrations/hypothesis/>`__ or
`HypoFuzz' CLI options <https://hypofuzz.com/docs/quickstart.html#running-hypothesis-fuzz>`__.

This is probably only useful for our own self-tests, but documented in case it might
help narrow down any particularly weird bugs in complex environments.

6.81.1

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

Fixes some lingering issues with inference of recursive types
in :func:`~hypothesis.strategies.from_type`. Closes :issue:`3525`.

6.81.0

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

This release further improves our ``.patch``-file support from
:ref:`version 6.75 <v6.75.0>`, skipping duplicates, tests which use
:func:`~hypothesis.strategies.data` (and don't support
:obj:`example() <hypothesis.example>`\ ), and various broken edge-cases.

Because :pypi:`libCST` has released version 1.0 which uses the native parser
by default, we no longer set the ``LIBCST_PARSER_TYPE=native`` environment
variable.  If you are using an older version, you may need to upgrade or
set this envvar for yourself.

6.80.1

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

This patch updates some internal code for selftests.
There is no user-visible change.

6.80.0

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

This release drops support for Python 3.7, `which reached end of life on
2023-06-27 <https://devguide.python.org/versions/>`__.

6.79.4

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

Fixes occasional recursion-limit-exceeded errors when validating
deeply nested strategies. Closes: :issue:`3671`

6.79.3

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

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.79.2

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

Improve the type rendered in :func:`~hypothesis.strategies.from_type`,
which improves the coverage of Ghostwriter.

6.79.1

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

We now test against Python 3.12 beta in CI, and this patch
fixes some new deprecations.

6.79.0

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

This release changes :func:`~hypothesis.strategies.register_type_strategy`
for compatibility with :pep:`585`: we now store only a single strategy or
resolver function which is used for both the builtin and the ``typing``
module version of each type (:issue:`3635`).

If you previously relied on registering separate strategies for e.g.
``list`` vs ``typing.List``, you may need to use explicit strategies
rather than inferring them from types.

6.78.3

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

This release ensures that Ghostwriter does not use the deprecated aliases
for the ``collections.abc`` classes in ``collections``.

6.78.2

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

This patch improves Ghostwriter's use of qualified names for re-exported
functions and classes, and avoids importing useless :obj:`~typing.TypeVar`\ s.

6.78.1

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

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.78.0

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

New input validation for :func:`~hypothesis.strategies.recursive`
will raise an error rather than hanging indefinitely if passed
invalid ``max_leaves=`` arguments.

6.77.0

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

:func:`~hypothesis.strategies.from_type` now handles numpy array types:
:obj:`np.typing.ArrayLike <numpy.typing.ArrayLike>`,
:obj:`np.typing.NDArray <numpy.typing.NDArray>`, and parameterized
versions including :class:`np.ndarray[shape, elem_type] <numpy.ndarray>`.

6.76.0

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

Warn in :func:`~hypothesis.strategies.from_type` if the inferred strategy
has no variation (always returning default instances). Also handles numpy
data types by calling :func:`~hypothesis.extra.numpy.from_dtype` on the
corresponding dtype, thus ensuring proper variation for these types.

6.75.9

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

:func:`~hypothesis.strategies.from_type` now works in cases where we use
:func:`~hypothesis.strategies.builds` to create an instance and the constructor
has an argument which would lead to recursion.  Previously, this would raise
an error if the argument had a default value.

Thanks to Joachim B Haga for reporting and fixing this problem.

6.75.8

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

In preparation for supporting JAX in :ref:`hypothesis.extra.array_api <array-api>`,
this release supports immutable arrays being generated via :func:`xps.arrays`.
In particular, we internally removed an instance of in-place array modification,
which isn't possible for an immutable array.

6.75.7

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

This release fixes some ``.patch``-file bugs from :ref:`version 6.75 <v6.75.0>`,
and adds automatic support for writing ``hypothesis.example()`` or ``example()``
depending on the current style in your test file - defaulting to the latter.

Note that this feature requires :pypi:`libcst` to be installed, and :pypi:`black`
is strongly recommended.  You can ensure you have the dependencies with
``pip install "hypothesis[cli,codemods]"``.

6.75.6

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

This patch continues the work started in :pull:`3651` by adding
:pypi:`ruff` linter rules for :pypi:`pyflakes`, :pypi:`flake8-comprehensions`,
and :pypi:`flake8-implicit-str-concat`.

6.75.5

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

This patch updates our linter stack to use :pypi:`ruff`, and fixes some
previously-ignored lints.  Thanks to Christian Clauss for his careful
review and :pull:`3651`!

6.75.4

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

Hypothesis will now record an event for more cases where data is marked
invalid, including for exceeding the internal depth limit.

6.75.3

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

This patch fixes :func:`~hypothesis.strategies.complex_numbers` accidentally
invalidating itself when passed magnitude arguments for 32 and 64-bit widths,
i.e. 16- and 32-bit floats, due to not internally down-casting numbers (:issue:`3573`).

6.75.2

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

Improved the documentation regarding how to use :class:`~hypothesis.database.GitHubArtifactDatabase`
and fixed a bug that occurred in repositories with no existing artifacts.

Thanks to Agustín Covarrubias for this contribution.

6.75.1

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

``hypothesis.errors`` will now raise :py:exc:`AttributeError` when attempting
to access an undefined attribute, rather than returning :py:obj:`None`.

6.75.0

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

Sick of adding :obj:`example() <hypothesis.example>`\ s by hand?
Our Pytest plugin now writes ``.patch`` files to insert them for you, making
`this workflow <https://blog.nelhage.com/post/property-testing-like-afl/>`__
easier than ever before.

Note that you'll need :pypi:`LibCST` (via :ref:`codemods`), and that
:obj:`example().via() <hypothesis.example.via>` requires :pep:`614`
(Python 3.9 or later).

6.74.1

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

This patch provides better error messages for datetime- and timedelta-related
invalid dtypes in our Pandas extra (:issue:`3518`).
Thanks to Nick Muoh at the PyCon Sprints!

6.74.0

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

This release adds support for `nullable pandas dtypes <https://pandas.pydata.org/docs/user_guide/integer_na.html>`__
in :func:`~hypothesis.extra.pandas` (:issue:`3604`).
Thanks to Cheuk Ting Ho for implementing this at the PyCon sprints!

6.73.1

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

This patch updates our minimum Numpy version to 1.16, and restores compatibility
with versions before 1.20, which were broken by a mistake in Hypothesis 6.72.4
(:issue:`3625`).

6.73.0

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

This release upgrades the :ref:`explain phase <phases>` (:issue:`3411`).

* Following the first failure, Hypothesis will (:ref:`usually <phases>`) track which
lines of code were executed by passing and failing examples, and report where they
diverged - with some heuristics to drop unhelpful reports.  This is an existing
feature, now upgraded and newly enabled by default.

* After shrinking to a minimal failing example, Hypothesis will try to find parts of
the example -- e.g. separate args to :func:`given() <hypothesis.given>` -- which
can vary freely without changing the result of that minimal failing example.
If the automated experiments run without finding a passing variation, we leave a
comment in the final report:

.. code-block:: python

   test_x_divided_by_y(
       x=0,   or any other generated value
       y=0,
   )

Just remember that the *lack* of an explanation sometimes just means that Hypothesis
couldn't efficiently find one, not that no explanation (or simpler failing example)
exists.

6.72.4

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

This patch fixes type annotations for the :func:`~hypothesis.extra.numpy.arrays`
strategy.  Thanks to Francesc Elies for :pull:`3602`.

6.72.3

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

This patch fixes a bug with :func:`~hypothesis.strategies.from_type()` with ``dict[tuple[int, int], str]``
(:issue:`3527`).

 Thanks to Nick Muoh at the PyCon Sprints!

6.72.2

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

This patch refactors our internals to facilitate an upcoming feature.

6.72.1

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

This patch fixes some documentation and prepares for future features.

6.72.0

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

This release deprecates ``Healthcheck.all()``, and :ref:`adds a codemod <codemods>`
to automatically replace it with ``list(Healthcheck)`` (:issue:`3596`).

6.71.0

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

This release adds :class:`~hypothesis.database.GitHubArtifactDatabase`, a new database
backend that allows developers to access the examples found by a Github Actions CI job.
This is particularly useful for workflows that involve continuous fuzzing,
like `HypoFuzz <https://hypofuzz.com/>`__.

Thanks to Agustín Covarrubias for this feature!

6.70.2

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

This patch clarifies the reporting of time spent generating data. A
simple arithmetic mean of the percentage of time spent can be
misleading; reporting the actual time spent avoids misunderstandings.

Thanks to Andrea Reina for reporting and fixing :issue:`3598`!

6.70.1

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

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.70.0

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

This release adds an optional ``domains=`` parameter to the
:func:`~hypothesis.strategies.emails` strategy, and excludes
the special-use :wikipedia:`.arpa` domain from the default
strategy (:issue:`3567`).

Thanks to Jens Tröger for reporting and fixing this bug!

6.69.0

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

This release turns ``HealthCheck.return_value`` and ``HealthCheck.not_a_test_method``
into unconditional errors.  Passing them to ``suppress_health_check=`` is therefore a deprecated no-op.
(:issue:`3568`).  Thanks to Reagan Lee for the patch!

Separately, GraalPy can now run and pass most of the hypothesis test suite (:issue:`3587`).

6.68.3

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

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.68.2

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

This patch fixes missing imports of the :mod:`re` module, when :doc:`ghostwriting <ghostwriter>`
tests which include compiled patterns or regex flags.
Thanks to Jens Heinrich for reporting and promptly fixing this bug!

6.68.1

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

This patch adds some private hooks for use in research on
`Schemathesis <https://github.com/schemathesis/schemathesis>`__
(`see our preprint here <https://arxiv.org/abs/2112.10328>`__).
Links

@pyup-bot
Copy link
Collaborator Author

Closing this in favor of #1133

@pyup-bot pyup-bot closed this Nov 13, 2023
@jelitox jelitox deleted the pyup-update-hypothesis-6.68.0-to-6.88.3 branch November 13, 2023 19:58
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