From 60994d2dafd6e8feccee7ecf14426634ffe2f19c Mon Sep 17 00:00:00 2001 From: sobolevn Date: Sun, 1 Dec 2024 20:23:55 +0300 Subject: [PATCH] Fix CI partially --- returns/contrib/hypothesis/laws.py | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/returns/contrib/hypothesis/laws.py b/returns/contrib/hypothesis/laws.py index 0c29389a..00278807 100644 --- a/returns/contrib/hypothesis/laws.py +++ b/returns/contrib/hypothesis/laws.py @@ -157,24 +157,14 @@ def factory(thing) -> st.SearchStrategy: pure=True, ) - callable_type = _get_callable_type() - used = types._global_type_lookup[callable_type] - st.register_type_strategy(callable_type, factory) + used = types._global_type_lookup[Callable] + st.register_type_strategy(Callable, factory) try: yield finally: - types._global_type_lookup.pop(callable_type) - st.register_type_strategy(callable_type, used) - - -def _get_callable_type() -> Any: - # Helper to accommodate changes in `hypothesis@6.79.0` - if Callable.__origin__ in types._global_type_lookup: # type: ignore - return Callable.__origin__ # type: ignore - elif Callable in types._global_type_lookup: # type: ignore - return Callable - raise RuntimeError('Failed to find Callable type strategy') + types._global_type_lookup.pop(Callable) + st.register_type_strategy(Callable, used) @contextmanager