python-etcd3 icon indicating copy to clipboard operation
python-etcd3 copied to clipboard

Update hypothesis to 6.54.4

Open pyup-bot opened this issue 3 years ago • 0 comments

This PR updates hypothesis from 6.13.1 to 6.54.4.

Changelog

6.54.4

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

This patch fixes some type annotations for Python 3.9 and earlier (:issue:`3397`),
and teaches :ref:`explain mode <phases>` about certain locations it should not
bother reporting (:issue:`3439`).

6.54.3

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

This patch teaches the Ghostwriter an additional check for function
and class locations that should make it use public APIs more often.

6.54.2

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

This patch fixes our workaround for `a pytest bug where the inner exceptions in
an ExceptionGroup are not displayed <https://github.com/pytest-dev/pytest/issues/9159>`__
(:issue:`3430`).

6.54.1

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

This patch makes ``FailedHealthCheck`` and ``DeadlineExceeded`` exceptions
picklable, for compatibility with Django's parallel test runner (:issue:`3426`).

6.54.0

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

Reporting of :obj:`multiple failing examples <hypothesis.settings.report_multiple_bugs>`
now uses the :pep:`654` `ExceptionGroup <https://docs.python.org/3.11/library/exceptions.html#ExceptionGroup>`__ type, which is provided by the
:pypi:`exceptiongroup` backport on Python 3.10 and earlier (:issue:`3175`).
``hypothesis.errors.MultipleFailures`` is therefore deprecated.

Failing examples and other reports are now stored as :pep:`678` exception notes, which
ensures that they will always appear together with the traceback and other information
about their respective error.

6.53.0

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

:func:`~hypothesis.extra.django.from_field` now supports ``UsernameField``
from :mod:`django.contrib.auth.forms`.

Thanks to Afonso Silva for reporting and working on :issue:`3417`.

6.52.4

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

This patch improves the error message when you pass filenames to the :command:`hypothesis write`
CLI, which takes the name of a module or function (e.g. :command:`hypothesis write gzip` or
:command:`hypothesis write package.some_function` rather than :command:`hypothesis write script.py`).

Thanks to Ed Rogers for implementing this as part of the SciPy 2022 sprints!

6.52.3

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

This patch ensures that the warning for non-interactive ``.example()``
points to your code instead of Hypothesis internals (:issue:`3403`).

Thanks to jameslamb for this fix.

6.52.2

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

This patch makes :func:`~hypothesis.strategies.integers` more likely to
generate boundary values for large two-sided intervals (:issue:`2942`).

6.52.1

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

This patch adds filter rewriting for :func:`math.isfinite`, :func:`math.isinf`, and :func:`math.isnan`
on :func:`~hypothesis.strategies.integers` or :func:`~hypothesis.strategies.floats` (:issue:`2701`).

Thanks to Sam Clamons at the SciPy Sprints!

6.52.0

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

This release adds the ``allow_subnormal`` argument to :func:`~hypothesis.strategies.complex_numbers` by
applying it to each of the real and imaginary parts separately. Closes :issue:`3390`.

Thanks to Evan Tey for this fix.

6.51.0

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

Issue a deprecation warning if a function decorated with
:func:`composite <hypothesis.strategies.composite>`
does not draw any values (:issue:`3384`).

Thanks to Grzegorz Zieba, Rodrigo Girão, and Thomas Ball for
working on this at the EuroPython sprints!

6.50.1

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

This patch improves the error messages in :func:`example() <hypothesis.example>`
argument validation following the recent release of :ref:`6.49.1 <v6.49.1>`.

6.50.0

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

This release allows :func:`~hypothesis.extra.numpy.from_dtype` to generate
Unicode strings which cannot be encoded in UTF-8, but are valid in Numpy
arrays (which use UTF-32).

This logic will only be used with :pypi:`Numpy` >= 1.19, because earlier
versions have `an issue <https://github.com/numpy/numpy/issues/15363>`__
which led us to revert :ref:`Hypothesis 5.2 <v5.2.0>` last time!

6.49.1

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

This patch fixes some inconsistency between argument handling for
:func:`example <hypothesis.example>` and :func:`given <hypothesis.given>`
(:issue:`2706 <2706issuecomment-1168363177>`).

6.49.0

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

This release uses :pep:`612` :obj:`python:typing.ParamSpec` (or the
:pypi:`typing_extensions` backport) to express the first-argument-removing
behaviour of :func:`st.composite <hypothesis.strategies.composite>`
and signature-preservation of :func:`~hypothesis.strategies.functions`
to IDEs, editor plugins, and static type checkers such as :pypi:`mypy`.

6.48.3

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

:func:`hypothesis.event` now works for hashable objects which do not
support weakrefs, such as integers and tuples.

6.48.2

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

This patch tidies up some internal introspection logic, which will improve
support for positional-only arguments in a future release (:issue:`2706`).

6.48.1

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

This release automatically rewrites some simple filters, such as
``floats().filter(lambda x: x >= 10)`` to the more efficient
``floats(min_value=10)``, based on the AST of the predicate.

We continue to recommend using the efficient form directly wherever
possible, but this should be useful for e.g. :pypi:`pandera` "``Checks``"
where you already have a simple predicate and translating manually
is really annoying.  See :issue:`2701` for details.

6.48.0

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

This release raises :class:`~unittest.SkipTest` for which never executed any
examples, for example because the :obj:`~hypothesis.settings.phases` setting
excluded the :obj:`~hypothesis.Phase.explicit`, :obj:`~hypothesis.Phase.reuse`,
and :obj:`~hypothesis.Phase.generate` phases.  This helps to avoid cases where
broken tests appear to pass, because they didn't actually execute (:issue:`3328`).

6.47.5

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

This patch fixes type annotations that had caused the signature of
:func:`given <hypothesis.given>` to be partially-unknown to type-checkers for Python
versions before 3.10.

6.47.4

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

This patch fixes :func:`~hypothesis.strategies.from_type` on Python 3.11,
following `python/cpython93754 <https://github.com/python/cpython/pull/93754/>`__.

6.47.3

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

This patch makes the :obj:`~hypothesis.HealthCheck.too_slow` health check more
consistent with long :obj:`~hypothesis.settings.deadline` tests (:issue:`3367`)
and fixes an install issue under :pypi:`pipenv` which was introduced in
:ref:`Hypothesis 6.47.2 <v6.47.2>` (:issue:`3374`).

6.47.2

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

We now use the :pep:`654` `ExceptionGroup <https://docs.python.org/3.11/library/exceptions.html#ExceptionGroup>`__
type - provided by the :pypi:`exceptiongroup` backport on older Pythons -
to ensure that if multiple errors are raised in teardown, they will all propagate.

6.47.1

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

Our pretty-printer no longer sorts dictionary keys, since iteration order is
stable in Python 3.7+ and this can affect reproducing examples (:issue:`3370`).
This PR was kindly supported by `Ordina Pythoneers
<https://www.ordina.nl/vakgebieden/python/>`__.

6.47.0

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

The :doc:`Ghostwritter <ghostwriter>` can now write tests for
:obj:`classmethod <classmethod>` or :obj:`staticmethod <staticmethod>`
methods, in addition to the existing support for functions and other callables
(:issue:`3318`).  Thanks to Cheuk Ting Ho for the patch.

6.46.11

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

Mention :func:`hypothesis.strategies.timezones`
in the documentation of :func:`hypothesis.strategies.datetimes` for completeness.

Thanks to George Macon for this addition.

6.46.10

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

This release contains some small improvements to our documentation.
Thanks to Felix Divo for his contribution!

6.46.9

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

This patch by Adrian Garcia Badaracco adds type annotations
to some private internals (:issue:`3074`).

6.46.8

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

This patch by Phillip Schanely makes changes to the
:func:`~hypothesis.strategies.floats` strategy when ``min_value`` or ``max_value`` is
present.
Hypothesis will now be capable of generating every representable value in the bounds.
You may notice that hypothesis is more likely to test values near boundaries, and values
that are very close to zero.

These changes also support future integrations with symbolic execution tools and fuzzers
(:issue:`3086`).

6.46.7

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

This patch updates the type annotations for :func:`~hypothesis.strategies.tuples` and
:func:`~hypothesis.strategies.one_of` so that type-checkers require its arguments to be
positional-only, and so that it no longer fails under pyright-strict mode (see
:issue:`3348`). Additional changes are made to Hypothesis' internals improve pyright
scans.

6.46.6

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

This patch by Cheuk Ting Ho adds support for :pep:`655` ``Required`` and ``NotRequired`` as attributes of
:class:`~python:typing.TypedDict` in :func:`~hypothesis.strategies.from_type` (:issue:`3339`).

6.46.5

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

This patch fixes :func:`~hypothesis.extra.numpy.from_dtype` with long-precision
floating-point datatypes (typecode ``g``; see :func:`numpy:numpy.typename`).

6.46.4

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

This patch improves some error messages for custom signatures
containing invalid parameter names (:issue:`3317`).

6.46.3

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

This patch by Cheuk Ting Ho makes it an explicit error to call :func:`~hypothesis.strategies.from_type`
or :func:`~hypothesis.strategies.register_type_strategy` with types that have no runtime instances (:issue:`3280`).

6.46.2

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

This patch fixes silently dropping examples when the :func:`example <hypothesis.example>`
decorator is applied to itself (:issue:`3319`).  This was always a weird pattern, but now it
works.  Thanks to Ray Sogata, Keeri Tramm, and Kevin Khuong for working on this patch!

6.46.1

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

This patch fixes a rare bug where we could incorrectly treat
:obj:`~python:inspect.Parameter.empty` as a type annotation,
if the callable had an explicitly assigned ``__signature__``.

6.46.0

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

This release adds an ``allow_nil`` argument to :func:`~hypothesis.strategies.uuids`,
which you can use to... generate the nil UUID.  Thanks to Shlok Gandhi for the patch!

6.45.4

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

This patch fixes some missing imports for certain :doc:`Ghostwritten <ghostwriter>`
tests.  Thanks to Mel Seto for fixing :issue:`3316`.

6.45.3

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

This patch teaches :doc:`the Ghostwriter <ghostwriter>` to recognize
many more common argument names (:issue:`3311`).

6.45.2

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

This patch fixes :issue:`3314`, where Hypothesis would raise an internal
error from :func:`~hypothesis.provisional.domains` or (only on Windows)
from :func:`~hypothesis.strategies.timezones` in some rare circumstances
where the installation was subtly broken.

Thanks to Munir Abdinur for this contribution.

6.45.1

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

This release fixes deprecation warnings about ``sre_compile`` and ``sre_parse``
imports and ``importlib.resources`` usage when running Hypothesis on Python 3.11.

Thanks to Florian Bruhin for this contribution.

6.45.0

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

This release updates :func:`xps.indices` by introducing an ``allow_newaxis``
argument, defaulting to ``False``. If ``allow_newaxis=True``, indices can be
generated that add dimensions to arrays, which is achieved by the indexer
containing ``None``. This change is to support a specification change that
expand dimensions via indexing (`data-apis/array-api408
<https://github.com/data-apis/array-api/pull/408>`_).

6.44.0

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

This release adds a ``names`` argument to :func:`~hypothesis.extra.pandas.indexes`
and :func:`~hypothesis.extra.pandas.series`, so that you can create Pandas
objects with specific or varied names.

Contributed by Sam Watts.

6.43.3

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

This patch updates the type annotations for :func:`given <hypothesis.given>`
so that type-checkers will warn on mixed positional and keyword arguments,
as well as fixing :issue:`3296`.

6.43.2

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

Fixed a type annotation for ``pyright --strict`` (:issue:`3287`).

6.43.1

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

This patch makes it an explicit error to call
:func:`~hypothesis.strategies.register_type_strategy` with a
`Pydantic GenericModel <https://pydantic-docs.helpmanual.io/usage/models/#generic-models>`__
and a callable, because ``GenericModel`` isn't actually a generic type at
runtime and so you have to register each of the "parametrized versions"
(actually subclasses!) manually.  See :issue:`2940` for more details.

6.43.0

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

This release makes it an explicit error to apply
:func:`pytest.fixture <pytest:pytest.fixture>` to a function which has
already been decorated with :func:`given() <hypothesis.given>`.  Previously,
``pytest`` would convert your test to a fixture, and then never run it.

6.42.3

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

This patch fixes :func:`~hypothesis.strategies.from_type` on a :class:`~python:typing.TypedDict`
with complex annotations, defined in a file using ``from __future__ import annotations``.
Thanks to Katelyn Gigante for identifying and fixing this bug!

6.42.2

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

The Hypothesis pytest plugin was not outputting valid xunit2 nodes when
``--junit-xml`` was specified. This has been broken since Pytest 5.4, which
changed the internal API for adding nodes to the junit report.

This also fixes the issue when using hypothesis with ``--junit-xml`` and
``pytest-xdist`` where the junit xml report would not be xunit2 compatible.
Now, when using with ``pytest-xdist``, the junit report will just omit the
``<properties>`` node.

For more details, see `this pytest issue <https://github.com/pytest-dev/pytest/issues/1126#issuecomment-484581283>`__,
`this pytest issue <https://github.com/pytest-dev/pytest/issues/7767#issuecomment-1082436256>`__,
and :issue:`1935`

Thanks to Brandon Chinn for this bug fix!

6.42.1

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

This patch fixes pretty-printing of regular expressions in Python 3.11.0a7, and
updates our vendored `list of top-level domains <https://www.iana.org/domains/root/db>`__,.

6.42.0

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

This release makes ``st.functions(pure=True)`` less noisy (:issue:`3253`),
and generally improves pretty-printing of functions.

6.41.0

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

This release changes the implementation of :const:`~hypothesis.infer` to be an alias
for :obj:`python:Ellipsis`. E.g. ``given(a=infer)`` is now equivalent to ``given(a=...)``. Furthermore, ``given(...)`` can now be specified so that
:func:`given <hypothesis.given>` will infer the strategies for *all* arguments of the
decorated function based on its annotations.

6.40.3

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

This patch simplifies the repr of the strategies namespace returned in
:func:`~hypothesis.extra.array_api.make_strategies_namespace`, e.g.

.. code-block:: pycon

 >>> from hypothesis.extra.array_api import make_strategies_namespace
 >>> from numpy import array_api as xp
 >>> xps = make_strategies_namespace(xp)
 >>> xps
 make_strategies_namespace(numpy.array_api)

6.40.2

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

Fixed :func:`~hypothesis.strategies.from_type` support for
:pep:`604` union types, like ``int | None`` (:issue:`3255`).

6.40.1

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

Fixed an internal error when ``given()`` was passed a lambda.

6.40.0

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

:doc:`The Ghostwriter <ghostwriter>` can now write tests which check that
two or more functions are equivalent on valid inputs, *or* raise the same
type of exception for invalid inputs (:issue:`3267`).

6.39.6

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

This patch makes some quality-of-life improvements to the
:doc:`Ghostwriter <ghostwriter>`: we guess the :func:`~hypothesis.strategies.text`
strategy for arguments named ``text`` (...obvious in hindsight, eh?);
and improved the error message if you accidentally left in a
:func:`~hypothesis.strategies.nothing` or broke your :pypi:`rich` install.

6.39.5

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

This patch improves our error detection and message when Hypothesis is run
on a Python implementation without support for ``-0.0``, which is required
for the :func:`~hypothesis.strategies.floats` strategy but can be disabled by
`unsafe compiler options <https://simonbyrne.github.io/notes/fastmath/>`__
(:issue:`3265`).

6.39.4

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

This patch tweaks some internal formatting.  There is no user-visible change.

6.39.3

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

If the :obj:`~hypothesis.Phase.shrink` phase is disabled, we now stop the
:obj:`~hypothesis.Phase.generate` phase as soon as an error is found regardless
of the value of the ``report_multiple_examples`` setting, since that's
probably what you wanted (:issue:`3244`).

6.39.2

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

This patch clarifies rare error messages in
:func:`~hypothesis.strategies.builds` (:issue:`3225`) and
:func:`~hypothesis.strategies.floats` (:issue:`3207`).

6.39.1

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

This patch fixes a regression where the bound inner function
(``your_test.hypothesis.inner_test``) would be invoked with positional
arguments rather than passing them by name, which broke
:pypi:`pytest-asyncio` (:issue:`3245`).

6.39.0

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

This release improves Hypothesis' handling of positional-only arguments,
which are now allowed :func:`st.composite <hypothesis.strategies.composite>`
strategies.

On Python 3.8 and later, the first arguments to :func:`~hypothesis.strategies.builds`
and :func:`~hypothesis.extra.django.from_model` are now natively positional-only.
In cases which were already errors, the ``TypeError`` from incorrect usage will
therefore be raises immediately when the function is called, rather than when
the strategy object is used.

6.38.0

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

This release makes :func:`~hypothesis.strategies.floats` error *consistently* when
your floating-point hardware has been configured to violate IEEE-754 for
:wikipedia:`subnormal numbers <Subnormal_number>`, instead of
only when an internal assertion was tripped (:issue:`3092`).

If this happens to you, passing ``allow_subnormal=False`` will suppress the explicit
error.  However, we strongly recommend fixing the root cause by disabling global-effect
unsafe-math compiler options instead, or at least consulting e.g. Simon Byrne's
`Beware of fast-math <https://simonbyrne.github.io/notes/fastmath/>`__ explainer first.

6.37.2

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

This patch fixes a bug in stateful testing, where returning a single value
wrapped in :func:`~hypothesis.stateful.multiple` would be printed such that
the assigned variable was a tuple rather than the single element
(:issue:`3236`).

6.37.1

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

This patch fixes a warning under :pypi:`pytest` 7 relating to our
rich traceback display logic (:issue:`3223`).

6.37.0

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

When distinguishing multiple errors, Hypothesis now looks at the inner
exceptions of :pep:`654` ``ExceptionGroup``\ s.

6.36.2

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

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

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

This patch fixes some deprecation warnings from :pypi:`pytest` 7.0,
along with some code formatting and docs updates.

6.36.0

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

This release disallows using :obj:`python:typing.Final`
with :func:`~hypothesis.strategies.from_type`
and :func:`~hypothesis.strategies.register_type_strategy`.

Why?
Because ``Final`` can only be used during ``class`` definition.
We don't generate class attributes.

It also does not make sense as a runtime type on its own.

6.35.1

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

This patch fixes ``hypothesis write`` output highlighting with :pypi:`rich`
version 12.0 and later.

6.35.0

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

This release disallows using :obj:`python:typing.ClassVar`
with :func:`~hypothesis.strategies.from_type`
and :func:`~hypothesis.strategies.register_type_strategy`.

Why?
Because ``ClassVar`` can only be used during ``class`` definition.
We don't generate class attributes.

It also does not make sense as a runtime type on its own.

6.34.2

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

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

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

This patch fixes :issue:`3169`, an extremely rare bug which would
trigger if an internal least-recently-reused cache dropped a newly
added entry immediately after it was added.

6.34.0

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

This release fixes :issue:`3133` and :issue:`3144`, where attempting
to generate Pandas series of lists or sets would fail with confusing
errors if you did not specify ``dtype=object``.

6.33.0

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

This release disallows using :obj:`python:typing.TypeAlias`
with :func:`~hypothesis.strategies.from_type`
and :func:`~hypothesis.strategies.register_type_strategy`.

Why? Because ``TypeAlias`` is not really a type,
it is a tag for type checkers that some expression is a type alias,
not something else.

It does not make sense for Hypothesis to resolve it as a strategy.
References :issue:`2978`.

6.32.1

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

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

6.32.0

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

This release drops support for Python 3.6, which `reached end of life upstream
<https://devguide.python.org/#status-of-python-branches>`__ on 2021-12-23.

6.31.6

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

This patch adds a temporary hook for a downstream tool,
which is not part of the public API.

6.31.5

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

This release updates our copyright headers to `use a general authorship statement and omit the year
<https://www.linuxfoundation.org/blog/copyright-notices-in-open-source-software-projects/>`__.

6.31.4

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

This patch makes the ``.example()`` method more representative of
test-time data generation, albeit often at a substantial cost to
readability (:issue:`3182`).

6.31.3

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

This patch improves annotations on some of Hypothesis' internal functions, in order to
deobfuscate the signatures of some strategies. In particular, strategies shared between
:ref:`hypothesis.extra.numpy <hypothesis-numpy>` and
:ref:`the hypothesis.extra.array_api extra <array-api>` will benefit from this patch.

6.31.2

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

This patch fix invariants display in stateful falsifying examples (:issue:`3185`).

6.31.1

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

This patch updates :func:`xps.indices` so no flat indices are generated, i.e.
generated indices will now always explicitly cover each axes of an array if no
ellipsis is present. This is to be consistent with a specification change that
dropped support for flat indexing
(`272 <https://github.com/data-apis/array-api/pull/272>`_).

6.31.0

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

This release makes us compatible with :pypi:`Django` 4.0, in particular by adding
support for use of :mod:`zoneinfo` timezones (though we respect the new
``USE_DEPRECATED_PYTZ`` setting if you need it).

6.30.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.30.0

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

This release adds an ``allow_subnormal`` argument to the
:func:`~hypothesis.strategies.floats` strategy, which can explicitly toggle the
generation of :wikipedia:`subnormal floats <Subnormal_number>` (:issue:`3155`).
Disabling such generation is useful when testing flush-to-zero builds of
libraries.

:func:`nps.from_dtype() <hypothesis.extra.numpy.from_dtype>` and
:func:`xps.from_dtype` can also accept the ``allow_subnormal`` argument, and
:func:`xps.from_dtype` or :func:`xps.arrays` will disable subnormals by default
if the array module ``xp`` is detected to flush-to-zero (like is typical with
CuPy).

6.29.3

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

This patch fixes a bug in :func:`~hypothesis.extra.numpy.mutually_broadcastable_shapes`,
which restricted the patterns of singleton dimensions that could be generated for
dimensions that extended beyond ``base_shape`` (:issue:`3170`).

6.29.2

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

This patch clarifies our pretty-printing of DataFrames (:issue:`3114`).

6.29.1

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

This patch documents :func:`~hypothesis.strategies.timezones`
`Windows-only requirement <https://docs.python.org/3/library/zoneinfo.html#data-sources>`__
for the :pypi:`tzdata` package, and ensures that
``pip install hypothesis[zoneinfo]`` will install the latest version.

6.29.0

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

This release teaches :func:`~hypothesis.strategies.builds` to use
:func:`~hypothesis.strategies.deferred` when resolving unrecognised type hints,
so that you can conveniently register strategies for recursive types
with constraints on some arguments (:issue:`3026`):

.. code-block:: python

 class RecursiveClass:
     def __init__(self, value: int, next_node: typing.Optional["SomeClass"]):
         assert value > 0
         self.value = value
         self.next_node = next_node


 st.register_type_strategy(
     RecursiveClass, st.builds(RecursiveClass, value=st.integers(min_value=1))
 )

6.28.1

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

This release fixes some internal calculations related to collection sizes (:issue:`3143`).

6.28.0

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

This release modifies our :pypi:`pytest` plugin, to avoid importing Hypothesis
and therefore triggering :ref:`Hypothesis' entry points <entry-points>` for
test suites where Hypothesis is installed but not actually used (:issue:`3140`).

6.27.3

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

This release fixes :issue:`3080`, where :func:`~hypothesis.strategies.from_type`
failed on unions containing :pep:`585` builtin generic types (like ``list[int]``)
in Python 3.9 and later.

6.27.2

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

This patch makes the :command:`hypothesis codemod`
:ref:`command <hypothesis-cli>` somewhat faster.

6.27.1

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

This patch changes the backing datastructures of :func:`~hypothesis.register_random`
and a few internal caches to use :class:`weakref.WeakKeyDictionary`.  This reduces
memory usage and may improve performance when registered :class:`~random.Random`
instances are only used for a subset of your tests (:issue:`3131`).

6.27.0

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

This release teaches Hypothesis' multiple-error reporting to format tracebacks
using :pypi:`pytest` or :pypi:`better-exceptions`, if they are installed and
enabled (:issue:`3116`).

6.26.0

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

Did you know that of the 2\ :superscript:`64` possible floating-point numbers,
2\ :superscript:`53` of them are ``nan`` - and Python prints them all the same way?

While nans *usually* have all zeros in the sign bit and mantissa, this
`isn't always true <https://wingolog.org/archives/2011/05/18/value-representation-in-javascript-implementations>`__,
and :wikipedia:`'signaling' nans might trap or error <https://en.wikipedia.org/wiki/NaN#Signaling_NaN>`.
To help distinguish such errors in e.g. CI logs, Hypothesis now prints ``-nan`` for
negative nans, and adds a comment like `` Saw 3 signaling NaNs`` if applicable.

6.25.0

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

This release adds special filtering logic to make a few special cases
like ``s.map(lambda x: x)`` and ``lists().filter(len)`` more efficient
(:issue:`2701`).

6.24.6

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

This patch makes :func:`~hypothesis.strategies.floats` generate
:wikipedia:`"subnormal" floating point numbers <Subnormal_number>`
more often, as these rare values can have strange interactions with
`unsafe compiler optimisations like -ffast-math
<https://simonbyrne.github.io/notes/fastmath/#flushing_subnormals_to_zero>`__
(:issue:`2976`).

6.24.5

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

This patch fixes a rare internal error in the :func:`~hypothesis.strategies.datetimes`
strategy, where the implementation of ``allow_imaginary=False`` crashed when checking
a time during the skipped hour of a DST transition *if* the DST offset is negative -
only true of ``Europe/Dublin``, who we presume have their reasons - and the ``tzinfo``
object is a :pypi:`pytz` timezone (which predates :pep:`495`).

6.24.4

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

This patch gives Hypothesis it's own internal :class:`~random.Random` instance,
ensuring that test suites which reset the global random state don't induce
weird correlations between property-based tests (:issue:`2135`).

6.24.3

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

This patch updates documentation of :func:`~hypothesis.note`
(:issue:`3147`).

6.24.2

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

This patch updates internal testing for the :ref:`Array API extra <array-api>`
to be consistent with new specification changes: ``sum()`` not accepting
boolean arrays (`234 <https://github.com/data-apis/array-api/pull/234>`_),
``unique()`` split into separate functions
(`275 <https://github.com/data-apis/array-api/pull/275>`_), and treating NaNs
as distinct (`310 <https://github.com/data-apis/array-api/pull/310>`_). It has
no user visible impact.

6.24.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.24.0

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

This patch updates our vendored `list of top-level domains
<https://data.iana.org/TLD/tlds-alpha-by-domain.txt>`__, which is used
by the provisional :func:`~hypothesis.provisional.domains` strategy.

(did you know that gTLDs can be both `added <https://newgtlds.icann.org/en/>`__
and `removed <https://www.icann.org/resources/pages/gtld-registry-agreement-termination-2015-10-09-en>`__?)

6.23.4

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

This patch adds an error for when ``shapes`` in :func:`xps.arrays()` is not
passed as either a valid shape or strategy.

6.23.3

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

This patch updates our formatting with :pypi:`shed`.

6.23.2

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

This patch replaces external links to :doc:`NumPy <numpy:index>` API docs
with :mod:`sphinx.ext.intersphinx` cross-references. It is purely a documentation improvement.

6.23.1

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

This patch cleans up internal logic for :func:`xps.arrays()`. There is no
user-visible change.

6.23.0

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

This release follows :pypi:`pytest` in considering :class:`SystemExit` and
:class:`GeneratorExit` exceptions to be test failures, meaning that we will
shink to minimal examples and check for flakiness even though they subclass
:class:`BaseException` directly (:issue:`2223`).

:class:`KeyboardInterrupt` continues to interrupt everything, and will be
re-raised immediately.

6.22.0

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

This release adds :class:`~hypothesis.extra.django.LiveServerTestCase` and
:class:`~hypothesis.extra.django.StaticLiveServerTestCase` for django test.
Thanks to Ivan Tham for this feature!

6.21.6

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

This patch fixes some new linter warnings such as :pypi:`flake8-bugbear`'s
``B904`` for explicit exception chaining, so tracebacks might be a bit nicer.

6.21.5

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

This release fixes ``None`` being inferred as the float64 dtype in
:func:`~xps.from_dtype()` and :func:`~xps.arrays()` from the
:ref:`Array API extra <array-api>`.

6.21.4

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

This release fixes the type hint for the
:func:`given() <hypothesis.given>` decorator
when decorating an ``async`` function (:issue:`3099`).

6.21.3

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

This release improves Ghostwritten tests for builtins (:issue:`2977`).

6.21.2

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

This release deprecates use of both ``min_dims > len(shape)`` and
``max_dims > len(shape)`` when ``allow_newaxis == False`` in
:func:`~hypothesis.extra.numpy.basic_indices` (:issue:`3091`).

6.21.1

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

This release improves the behaviour of :func:`~hypothesis.strategies.builds`
and :func:`~hypothesis.strategies.from_type` in certain situations involving
decorators (:issue:`2495` and :issue:`3029`).

6.21.0

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

This release introduces strategies for array/tensor libraries adopting the
`Array API standard <https://data-apis.org/>`__ (:issue:`3037`).
They are available in :ref:`the hypothesis.extra.array_api extra <array-api>`,
and work much like the existing :doc:`strategies for NumPy <numpy>`.

6.20.1

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

This patch fixes :issue:`961`, where calling ``given()`` inline on a
bound method would fail to handle the ``self`` argument correctly.

6.20.0

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

This release allows :func:`~hypothesis.strategies.slices` to generate ``step=None``,
and fixes an off-by-one error where the ``start`` index could be equal to ``size``.
This works fine for all Python sequences and Numpy arrays, but is undefined behaviour
in the `Array API standard <https://data-apis.org/>`__ (see :pull:`3065`).

6.19.0

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

This release makes :doc:`stateful testing <stateful>` more likely to tell you
if you do something unexpected and unsupported:

- The :obj:`~hypothesis.HealthCheck.return_value` health check now applies to
:func:`~hypothesis.stateful.rule` and :func:`~hypothesis.stateful.initialize`
rules, if they don't have ``target`` bundles, as well as
:func:`~hypothesis.stateful.invariant`.
- Using a :func:`~hypothesis.stateful.consumes` bundle as a ``target`` is
deprecated, and will be an error in a future version.

If existing code triggers these new checks, check for related bugs and
misunderstandings - these patterns *never* had any effect.

6.18.0

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

This release teaches :func:`~hypothesis.strategies.from_type` a neat trick:
when resolving an :obj:`python:typing.Annotated` type, if one of the annotations
is a strategy object we use that as the inferred strategy.  For example:

.. code-block:: python

 PositiveInt = Annotated[int, st.integers(min_value=1)]

If there are multiple strategies, we use the last outer-most annotation.
See :issue:`2978` and :pull:`3082` for discussion.

*Requires Python 3.9 or later for*
:func:`get_type_hints(..., include_extras=False) <typing.get_type_hints>`.

6.17.4

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

This patch makes unique :func:`~hypothesis.extra.numpy.arrays` much more
efficient, especially when there are only a few valid elements - such as
for eight-bit integers (:issue:`3066`).

6.17.3

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

This patch fixes the repr of :func:`~hypothesis.extra.numpy.array_shapes`.

6.17.2

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

This patch wraps some internal helper code in our proxies decorator to prevent
mutations of method docstrings carrying over to other instances of the respective
methods.

6.17.1

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

This patch moves some internal helper code in preparation for :issue:`3065`.
There is no user-visible change, unless you depended on undocumented internals.

6.17.0

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

This release adds type annotations to the :doc:`stateful testing <stateful>` API.

Thanks to Ruben Opdebeeck for this contribution!

6.16.0

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

This release adds the :class:`~hypothesis.strategies.DrawFn` type as a reusable
type hint for the ``draw`` argument of
:func:`composite <hypothesis.strategies.composite>` functions.

Thanks to Ruben Opdebeeck for this contribution!

6.15.0

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

This release emits a more useful error message when :func:`given() <hypothesis.given>`
is applied to a coroutine function, i.e. one defined using ``async def`` (:issue:`3054`).

This was previously only handled by the generic :obj:`~hypothesis.HealthCheck.return_value`
health check, which doesn't direct you to use either :ref:`a custom executor <custom-function-execution>`
or a library such as :pypi:`pytest-trio` or :pypi:`pytest-asyncio` to handle it for you.

6.14.9

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

This patch fixes a regression in Hypothesis 6.14.8, where :func:`~hypothesis.strategies.from_type`
failed to resolve types which inherit from multiple parametrised generic types,
affecting the :pypi:`returns` package (:issue:`3060`).

6.14.8

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

This patch ensures that registering a strategy for a subclass of a a parametrised
generic type such as ``class Lines(Sequence[str]):`` will not "leak" into unrelated
strategies such as ``st.from_type(Sequence[int])`` (:issue:`2951`).
Unfortunately this fix requires :pep:`560`, meaning Python 3.7 or later.

6.14.7

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

This patch fixes :issue:`3050`, where :pypi:`attrs` classes could
cause an internal error in the :doc:`ghostwriter <ghostwriter>`.

6.14.6

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

This patch improves the error message for :issue:`3016`, where :pep:`585`
builtin generics with self-referential forward-reference strings cannot be
resolved to a strategy by :func:`~hypothesis.strategies.from_type`.

6.14.5

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

This patch fixes ``hypothesis.strategies._internal.types.is_a_new_type``.
It was failing on Python ``3.10.0b4``, where ``NewType`` is a function.

6.14.4

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

This patch fixes :func:`~hypothesis.strategies.from_type` and
:func:`~hypothesis.strategies.register_type_strategy` for
:obj:`python:typing.NewType` on Python 3.10, which changed the
underlying implementation (see :bpo:`44353` for details).

6.14.3

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

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

6.14.2

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

This patch ensures that we shorten tracebacks for tests which fail due
to inconsistent data generation between runs (i.e. raise ``Flaky``).

6.14.1

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

This patch updates some internal type annotations.
There is no user-visible change.

6.14.0

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

The :ref:`explain phase <phases>` now requires shrinking to be enabled,
and will be automatically skipped for deadline-exceeded errors.

6.13.14

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

This patch improves the :func:`~hypothesis.strategies.tuples` strategy
type annotations, to preserve the element types for up to length-five
tuples (:issue:`3005`).

As for :func:`~hypothesis.strategies.one_of`, this is the best we can do
before a `planned extension <https://mail.python.org/archives/list/typing-sigpython.org/thread/LOQFV3IIWGFDB7F5BDX746EZJG4VVBI3/>`__
to :pep:`646` is released, hopefully in Python 3.11.

6.13.13

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

This patch teaches :doc:`the Ghostwriter <ghostwriter>` how to find
:doc:`custom ufuncs <numpy:reference/ufuncs>` from *any* module that defines them,
and that ``yaml.unsafe_load()`` does not undo ``yaml.safe_load()``.

6.13.12

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

This patch reduces the amount of internal code excluded from our test suite's
code coverage checks.

There is no user-visible change.

6.13.11

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

This patch removes some old internal helper code that previously existed
to make Python 2 compatibility easier.

There is no user-visible change.

6.13.10

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

This release adjusts some internal code to help make our test suite more
reliable.

There is no user-visible change.

6.13.9

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

This patch cleans up some internal code related to filtering strategies.

There is no user-visible change.

6.13.8

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

This patch slightly improves the performance of some internal code for
generating integers.

6.13.7

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

This patch fixes a bug in :func:`~hypothesis.strategies.from_regex` that
caused ``from_regex("", fullmatch=True)`` to unintentionally generate non-empty
strings (:issue:`4982`).

The only strings that completely match an empty regex pattern are empty
strings.

6.13.6

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

This patch fixes a bug that caused :func:`~hypothesis.strategies.integers`
to shrink towards negative values instead of positive values in some cases.

6.13.5

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

This patch fixes rare cases where ``hypothesis write --binary-op`` could
print :doc:`reproducing instructions <reproducing>` from the internal
search for an identity element.

6.13.4

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

This patch removes some unnecessary intermediate list-comprehensions,
using the latest versions of :pypi:`pyupgrade` and :pypi:`shed`.

6.13.3

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

This patch adds a ``.hypothesis`` property to invalid test functions, bringing
them inline with valid tests and fixing a bug where :pypi:`pytest-asyncio` would
swallow the real error message and mistakenly raise a version incompatibility
error.

6.13.2

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

Some of Hypothesis's numpy/pandas strategies use a ``fill`` argument to speed
up generating large arrays, by generating a single fill value and sharing that
value among many array slots instead of filling every single slot individually.

When no ``fill`` argument is provided, Hypothesis tries to detect whether it is
OK to automatically use the ``elements`` argument as a fill strategy, so that
it can still use the faster approach.

This patch fixes a bug that would cause that optimization to trigger in some
cases where it isn't 100% guaranteed to be OK.

If this makes some of your numpy/pandas tests run more slowly, try adding an
explicit ``fill`` argument to the relevant strategies to ensure that Hypothesis
always uses the faster approach.
Links
  • PyPI: https://pypi.org/project/hypothesis
  • Changelog: https://pyup.io/changelogs/hypothesis/
  • Homepage: https://hypothesis.works

pyup-bot avatar Aug 21 '22 06:08 pyup-bot