Skip to content

Latest commit

 

History

History
19 lines (14 loc) · 640 Bytes

RELEASE.rst

File metadata and controls

19 lines (14 loc) · 640 Bytes

RELEASE_TYPE: minor

This release teaches ~hypothesis.strategies.builds to use ~hypothesis.strategies.deferred when resolving unrecognised type hints, so that you can conveniently register strategies for recursive types with constraints on some arguments (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))
)