Skip to content

Commit

Permalink
Fix hypothesis
Browse files Browse the repository at this point in the history
  • Loading branch information
sobolevn committed Jul 28, 2024
1 parent f8bc66d commit cefe4c5
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions returns/contrib/hypothesis/_entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,18 @@ def _setup_hook() -> None:
RequiresContextIOResult,
RequiresContextResult,
)
from returns.contrib.hypothesis.containers import strategy_from_container
from returns.future import Future, FutureResult
from returns.io import IO, IOResult
from returns.maybe import Maybe
from returns.primitives.laws import Lawful
from returns.result import Result

def factory(thing):
from returns.contrib.hypothesis.containers import (
strategy_from_container,
)
return strategy_from_container(thing)

#: Our types that we register in hypothesis
#: to be working with ``st.from_type``
registered_types: Sequence[Type[Lawful]] = (
Expand All @@ -43,7 +48,4 @@ def _setup_hook() -> None:
)

for type_ in registered_types:
st.register_type_strategy(
type_,
strategy_from_container(type_),
)
st.register_type_strategy(type_, factory)

0 comments on commit cefe4c5

Please sign in to comment.