Releases: HypothesisWorks/hypothesis
Hypothesis for Python - version 6.129.3
This patch improves the string representation of
"fixed_dictionaries()".
The canonical version of these notes (with links) is on readthedocs.
Hypothesis for Python - version 6.129.2
Improve how the shrinker checks for unnecessary work, leading to 10%
less time spent shrinking on average, with no reduction in quality.
The canonical version of these notes (with links) is on readthedocs.
Hypothesis for Python - version 6.129.1
"randoms()" no longer produces "1.0", matching the exclusive upper
bound of "random.Random.random" (issue #4297).
The canonical version of these notes (with links) is on readthedocs.
Hypothesis for Python - version 6.129.0
This release adds a ""hypothesis-urandom"" backend, which draws
randomness from "/dev/urandom" instead of Python's PRNG. This is
useful for users of Antithesis who also have Hypothesis tests,
allowing Antithesis mutation of "/dev/urandom" to drive Hypothesis
generation. We expect it to be strictly slower than the default
backend for everyone else.
It can be enabled with "@settings(backend="hypothesis-urandom")".
The canonical version of these notes (with links) is on readthedocs.
Hypothesis for Python - version 6.128.3
For strategies which draw make recursive draws, including
"recursive()" and "deferred()", we now generate examples with
duplicated subtrees more often. This tends to uncover interesting
behavior in tests.
For instance, we might now generate a tree like this more often
(though the details depend on the strategy):
┌─────┐
┌──────┤ a ├──────┐
│ └─────┘ │
┌──┴──┐ ┌──┴──┐
│ b │ │ a │
└──┬──┘ └──┬──┘
┌────┴────┐ ┌────┴────┐
┌──┴──┐ ┌──┴──┐ ┌──┴──┐ ┌──┴──┐
│ c │ │ d │ │ b │ │ ... │
└─────┘ └─────┘ └──┬──┘ └─────┘
┌────┴────┐
┌──┴──┐ ┌──┴──┐
│ c │ │ d │
└─────┘ └─────┘
The canonical version of these notes (with links) is on readthedocs.
Hypothesis for Python - version 6.128.2
Improves input validation for several strategies in our pandas extra,
so that they raise a helpful "InvalidArgument" rather than
"OverflowError".
Discovered by our recent string generation upgrade.
The canonical version of these notes (with links) is on readthedocs.
Hypothesis for Python - version 6.128.1
Rename a few internal classes for clarity.
The canonical version of these notes (with links) is on readthedocs.
Hypothesis for Python - version 6.128.0
"text()" now occasionally generates from a preselected list of strings
which are likely to find bugs. These include ligatures, right-to-left
and top-to-bottom text, emojis, emoji modifiers, strings like
""Infinity"", ""None"", and ""FALSE"", and other interesting things.
This is especially useful when testing the full unicode range, where
the search space is too large for uniform sampling to be very
effective.
Of course, examples generated this way shrink just like they normally
would. It was always possible for Hypothesis to generate these
strings; it is just more likely after this change. From the outside,
it is as if Hypothesis generated the example completely randomly.
Many thanks to the Big List of Naughty Strings, Text Rendering Hates
You, and Text Editing Hates You Too for forming the basis of this
list.
The canonical version of these notes (with links) is on readthedocs.
Hypothesis for Python - version 6.127.9
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
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.