Skip to content

Commit 6752293

Browse files
committed
update overloads for given; mixed pos & kwargs disallowed
1 parent ab8276d commit 6752293

File tree

1 file changed

+21
-2
lines changed
  • hypothesis-python/src/hypothesis

1 file changed

+21
-2
lines changed

hypothesis-python/src/hypothesis/core.py

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
Optional,
3535
TypeVar,
3636
Union,
37+
overload,
3738
)
3839
from unittest import TestCase
3940

@@ -970,9 +971,27 @@ def fuzz_one_input(
970971
return self.__cached_target
971972

972973

974+
@overload
973975
def given(
974-
*_given_arguments: Union[SearchStrategy[Ex], InferType],
975-
**_given_kwargs: Union[SearchStrategy[Ex], InferType],
976+
*_given_arguments: Union[SearchStrategy[Any], InferType],
977+
) -> Callable[
978+
[Callable[..., Union[None, Coroutine[Any, Any, None]]]], Callable[..., None]
979+
]: # pragma: no cover
980+
...
981+
982+
983+
@overload
984+
def given(
985+
**_given_kwargs: Union[SearchStrategy[Any], InferType],
986+
) -> Callable[
987+
[Callable[..., Union[None, Coroutine[Any, Any, None]]]], Callable[..., None]
988+
]: # pragma: no cover
989+
...
990+
991+
992+
def given(
993+
*_given_arguments: Union[SearchStrategy[Any], InferType],
994+
**_given_kwargs: Union[SearchStrategy[Any], InferType],
976995
) -> Callable[
977996
[Callable[..., Union[None, Coroutine[Any, Any, None]]]], Callable[..., None]
978997
]:

0 commit comments

Comments
 (0)