Skip to content

Commit

Permalink
aiohttp added type annotations, we need to fix as well as work around…
Browse files Browse the repository at this point in the history
… a few issues
  • Loading branch information
sjaensch committed Aug 27, 2018
1 parent 62dc29d commit 863a3c0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion bravado_asyncio/http_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from collections import Mapping
from typing import Any
from typing import Callable # noqa: F401
from typing import cast
from typing import Dict
from typing import Optional
from typing import Union
Expand Down Expand Up @@ -140,7 +141,7 @@ def request(

coroutine = self.client_session.request(
method=request_params.get('method') or 'GET',
url=request_params.get('url'),
url=cast(str, request_params.get('url', '')),
params=params,
data=data,
headers={
Expand Down
2 changes: 1 addition & 1 deletion bravado_asyncio/response_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def raw_bytes(self) -> bytes:

@property
def reason(self) -> str:
return self._delegate.reason
return self._delegate.reason # type: ignore # aiohttp.ClientResponse doesn't annotate this attribute correctly

@property
def headers(self) -> CIMultiDict:
Expand Down
3 changes: 2 additions & 1 deletion mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ warn_redundant_casts = True
warn_unused_ignores = True

[mypy-bravado_asyncio.*]
disallow_untyped_calls = True
# currently aiohttp has partial type annotations which cause errors if this option is set
disallow_untyped_calls = False
disallow_untyped_defs = True

0 comments on commit 863a3c0

Please sign in to comment.