Skip to content

Commit

Permalink
Fix mock_callable types
Browse files Browse the repository at this point in the history
  • Loading branch information
fornellas committed Nov 12, 2020
1 parent 7fd1c64 commit cb7e0ff
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions testslide/mock_callable.py
Original file line number Diff line number Diff line change
Expand Up @@ -884,7 +884,7 @@ def for_call(
##

def to_return_value(
self, value: Optional[Union[bool, str, int]]
self, value: Any
) -> Union["_MockCallableDSL", "_MockAsyncCallableDSL", "_MockConstructorDSL"]:
"""
Always return given value.
Expand All @@ -901,7 +901,7 @@ def to_return_value(
return self

def to_return_values(
self, values_list: Union[List[str], List[Union[int, str]]]
self, values_list: List[Any]
) -> Union["_MockCallableDSL", "_MockAsyncCallableDSL", "_MockConstructorDSL"]:
"""
For each call, return each value from given list in order.
Expand All @@ -921,7 +921,7 @@ def to_return_values(
return self

def to_yield_values(
self, values_list: List[str]
self, values_list: List[Any]
) -> Union["_MockCallableDSL", "_MockAsyncCallableDSL", "_MockConstructorDSL"]:
"""
Callable will return an iterator what will yield each value from the
Expand All @@ -941,7 +941,7 @@ def to_yield_values(
return self

def to_raise(
self, ex: Union[UnexpectedCallReceived, Type[RuntimeError], RuntimeError]
self, ex: Union[Type[BaseException], BaseException]
) -> Union["_MockCallableDSL", "_MockAsyncCallableDSL", "_MockConstructorDSL"]:
"""
Raises given exception class or exception instance.
Expand Down

0 comments on commit cb7e0ff

Please sign in to comment.