Skip to content

Releases: HypothesisWorks/hypothesis

Hypothesis for Python - version 6.127.9

06 Mar 18:00
Compare
Choose a tag to compare

We now provide a better string representation for "one_of()"
strategies, by flattening consecutive "|" combinations. For instance:

st.integers() | st.text() | st.booleans()

previously: one_of(one_of(integers(), text()), booleans())

one_of(integers(), text(), booleans())

Explicit calls to "one_of()" remain unflattened, in order to make
tracking down complicated "one_of()" constructions easier:

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.

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

Hypothesis for Python - version 6.127.8

06 Mar 06:46
Compare
Choose a tag to compare

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

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

Hypothesis for Python - version 6.127.7

05 Mar 20:01
Compare
Choose a tag to compare

Fix a type-hinting regression from version 6.125.1, where we would no
longer guarantee the type of the argument to ".filter" predicates
(issue #4269).

x was previously Unknown, but is now correctly guaranteed to be int

st.integers().filter(lambda x: x > 0)

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

Hypothesis for Python - version 6.127.6

04 Mar 02:38
Compare
Choose a tag to compare

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

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

Hypothesis for Python - version 6.127.5

03 Mar 09:42
Compare
Choose a tag to compare

This patch fixes a bug where "from_type()" would error on certain
types involving "Protocol" (issue #4194).

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

Hypothesis for Python - version 6.127.4

02 Mar 02:01
Compare
Choose a tag to compare

This patch updates our vendored list of top-level domains, which is
used by the provisional "domains()" strategy.

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

Hypothesis for Python - version 6.127.3

28 Feb 01:21
Compare
Choose a tag to compare

Hypothesis for Python - version 6.127.2

24 Feb 19:37
Compare
Choose a tag to compare

Adjust type hints for the pub-sub database implementation in version
6.126.0, and remove a remnant debug print in its implementation.

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

Hypothesis for Python - version 6.127.1

23 Feb 21:18
Compare
Choose a tag to compare

Improve the clarity of printing counterexamples in stateful testing,
by avoiding confusing "Bundle" references with equivalent values drawn
from a regular strategy.

For example, we now print:

instead of

if the "unrelated" rule draws from a regular strategy such as
"integers()" instead of the "a" bundle.

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

Hypothesis for Python - version 6.127.0

23 Feb 20:57
Compare
Choose a tag to compare

This releases adds support for type aliases created with the "type"
statement (new in python 3.12) to "from_type()" and
"register_type_strategy()".

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