Skip to content

Releases: HypothesisWorks/hypothesis

Hypothesis for Python - version 6.66.2

04 Feb 10:19
Compare
Choose a tag to compare

This patch fixes a rare "RecursionError" when pretty-printing a multi-
line object without type-specific printer, which was passed to a
function which returned the same object by ".map()" or "builds()" and
thus recursed due to the new pretty reprs in Hypothesis 6.65.0 -
2023-01-24 (issue #3560). Apologies to all those affected.

The canonical version of these notes (with links) is on readthedocs.

Hypothesis for Python - version 6.66.1

03 Feb 22:26
Compare
Choose a tag to compare

This makes "hypothesis.extra.numpy.from_dtype()" pass through the
parameter allow_subnormal for complex dtypes.

The canonical version of these notes (with links) is on readthedocs.

Hypothesis for Python - version 6.66.0

02 Feb 11:20
Compare
Choose a tag to compare

This release adds a "width" parameter to
"hypothesis.strategies.complex_numbers()", analogously to
"hypothesis.strategies.floats()".

Thanks to Felix Divo for the new feature!

The canonical version of these notes (with links) is on readthedocs.

Hypothesis for Python - version 6.65.2

27 Jan 10:09
Compare
Choose a tag to compare

This patch fixes invalid annotations detected for the tests generated
by Ghostwritter. It will now correctly generate "Optional" types with
just one type argument and handle union expressions inside of type
arguments correctly. Additionally, it now supports code with the "from
future import annotations" marker for Python 3.10 and newer.

The canonical version of these notes (with links) is on readthedocs.

Hypothesis for Python - version 6.65.1

26 Jan 14:46
Compare
Choose a tag to compare

This release improves the pretty-printing of enums in falsifying
examples, so that they print as their full identifier rather than
their repr.

The canonical version of these notes (with links) is on readthedocs.

Hypothesis for Python - version 6.65.0

24 Jan 10:50
Compare
Choose a tag to compare

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 "builds()", and via
SearchStrategy.map().

The canonical version of these notes (with links) is on readthedocs.

Hypothesis for Python - version 6.64.0

23 Jan 01:07
Compare
Choose a tag to compare

The Ghostwritter 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!

The canonical version of these notes (with links) is on readthedocs.

Hypothesis for Python - version 6.63.0

20 Jan 14:46
Compare
Choose a tag to compare

"range_indexes()" now accepts a "name=" argument, to generate named
"pandas.RangeIndex" objects.

Thanks to Sam Watts for this new feature!

The canonical version of these notes (with links) is on readthedocs.

Hypothesis for Python - version 6.62.1

14 Jan 12:33
Compare
Choose a tag to compare

This patch tweaks "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.

The canonical version of these notes (with links) is on readthedocs.

Hypothesis for Python - version 6.62.0

08 Jan 18:03
Compare
Choose a tag to compare

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 "@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.

The canonical version of these notes (with links) is on readthedocs.