github HypothesisWorks/hypothesis hypothesis-python-6.29.0
Hypothesis for Python - version 6.29.0

latest releases: hypothesis-python-6.118.3, hypothesis-python-6.118.2, hypothesis-python-6.118.1...
2 years ago

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

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))
)

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

Don't miss a new hypothesis release

NewReleases is sending notifications on new releases.