Skip to content

Releases: HypothesisWorks/hypothesis

Hypothesis version 6.153.1

Choose a tag to compare

@Zac-HD Zac-HD released this 27 May 00:21

This patch fixes a bug where we emitted incorrect git patch files when
one file did not have a trailing newline (issue #4744).

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

Hypothesis version 6.153.0

Choose a tag to compare

@Zac-HD Zac-HD released this 26 May 05:19

"event()"'s "payload" is now typed as accepting "Any", matching its
runtime behavior of accepting any string-coercible object.

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

Hypothesis version 6.152.12

Choose a tag to compare

@Zac-HD Zac-HD released this 26 May 04:11

When Hypothesis detects that your data generation is flaky and raises
"FlakyStrategyDefinition", the error message now describes what
differed between the two runs - such as a different choice type,
different constraints, or drawing more or less data - as well as the
stack of strategies being drawn from, instead of only reporting that
generation was inconsistent. In stateful tests, it also reports the
steps leading up to the error.

Thanks to Ian Hunt-Isaak for this improvement!

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

Hypothesis version 6.152.11

Choose a tag to compare

@Zac-HD Zac-HD released this 26 May 00:16

This patch adds support for recursive forward references in
"from_type()", such as "A = list[Union["A", str]]" (issue #4542).
Previously, such recursive type aliases would raise a
"ResolutionFailed" error. Now, Hypothesis can automatically resolve
the forward reference by looking it up in the caller's namespace. This
also resolves forward references inside "type[...]", such as
"type["MyClass"]".

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

Hypothesis version 6.152.10

Choose a tag to compare

@Zac-HD Zac-HD released this 25 May 20:31

This patch renames our source code directory from "hypothesis-python"
to "hypothesis", and changes our canonical scheme for git tags from
"hypothesis-python-X.Y.Z" to "vX.Y.Z".

We have backfilled git tags in the new "vX.Y.Z" scheme. Any
distributions or build scripts which rely on the git tag scheme should
update to the new scheme.

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

Hypothesis for Python - version 6.152.9

Choose a tag to compare

@Zac-HD Zac-HD released this 19 May 17:10

This release substantially improves our internal distribution for
generating integers. This release has the most visible effect on
"integers()", but may incidentally improve other strategies which draw
integers internally.

Our integers distribution had two problems. First, it had jagged
discontinuities at certain values where we switched sampling
approaches. Second, it used a different distribution for bounded and
unbounded ranges, which resulted in "st.integers()" and
"st.integers(-264, 264)" producing very different distributions
despite being semantically similar.

We now use a smooth distribution for both "st.integers()" and
"st.integers(a, b)", which fixes both of these issues. This should
substantially improve our testing power in certain cases.

The only way this release should be user-visible is that it finds more
bugs! If this release is user-visible in other ways - for example,
because it is slower, or produces a worse distribution in some cases -
please open an issue.

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

Hypothesis for Python - version 6.152.8

Choose a tag to compare

@Zac-HD Zac-HD released this 18 May 23:19

This release drops support for end-of-life Django 4.2.

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

Hypothesis for Python - version 6.152.7

Choose a tag to compare

@Zac-HD Zac-HD released this 13 May 04:19

This patch improves our type hints for ".filter()" to work with
"typing.TypeGuard". For example:

from typing import TypeGuard

from hypothesis import strategies as st

def is_str(x: object) -> TypeGuard[str]:
return isinstance(x, str)

s = st.from_type(object).filter(is_str)

previously: SearchStrategy[object]

now: SearchStrategy[str]

reveal_type(s)

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

Hypothesis for Python - version 6.152.6

Choose a tag to compare

@Zac-HD Zac-HD released this 11 May 13:13

This patch adds a shrinking pass that tries natural text
transformations - unicode decomposition (NFD/NFKD) and case mapping -
on individual characters in string choices. Failures involving e.g.
""À" != "À".lower()" will now reliably shrink to ""A"" rather than
sometimes getting stuck on the high-codepoint accented form (issue
#4725).

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

Hypothesis for Python - version 6.152.5

Choose a tag to compare

@Zac-HD Zac-HD released this 10 May 20:32

This patch improves the "Phase.explain" phase so that simple cases
like "assert n1 == n2" no longer get a misleading "# or any other
generated value" comment (issue #4715). Before falling back to random
sampling, we now also try borrowing values from each other arg slice
with matching shape.

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