Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions aioresponses/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ def __init__(self, method: str = hdrs.METH_GET,


class RequestMatch(object):
url_or_pattern = None # type: Union[URL, Pattern]
# type:ignore[assignment]
url_or_pattern: Union[URL, Pattern] = None

def __init__(self, url: Union[URL, str, Pattern],
method: str = hdrs.METH_GET,
Expand Down Expand Up @@ -150,7 +151,7 @@ def _build_response(self, url: 'Union[URL, str]',
loop = Mock()
loop.get_debug = Mock()
loop.get_debug.return_value = True
kwargs = {} # type: Dict[str, Any]
kwargs: Dict[str, Any] = {}
kwargs['request_info'] = RequestInfo(
url=url,
method=method,
Expand Down Expand Up @@ -222,9 +223,11 @@ def __repr__(self) -> str:

class aioresponses(object):
"""Mock aiohttp requests made by ClientSession."""
_matches = None # type: Dict[str, RequestMatch]
# type:ignore[assignment]
_matches: Dict[str, RequestMatch] = None
_responses: List[ClientResponse] = None
requests = None # type: Dict
# type:ignore[assignment]
requests: Dict[Tuple[str, URL], List[RequestCall]] = None

def __init__(self, **kwargs: Any):
self._param = kwargs.pop('param', None)
Expand Down