Skip to content

Commit

Permalink
Types: Fix last errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Viicos committed Jul 16, 2023
1 parent 6c5d2e2 commit 8811c1c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ combine-as-imports = true
[tool.mypy]
strict = true
ignore_missing_imports = true
python_version = "3.8"

[[tool.mypy.overrides]]
module = "starlette.testclient.*"
Expand Down
2 changes: 1 addition & 1 deletion starlette/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# check if the Python version supports the parameter
# using usedforsecurity=False to avoid an exception on FIPS systems
# that reject usedforsecurity=True
hashlib.md5(b"data", usedforsecurity=False)
hashlib.md5(b"data", usedforsecurity=False) # type: ignore[call-arg]

def md5_hexdigest(
data: bytes, *, usedforsecurity: bool = True
Expand Down
18 changes: 9 additions & 9 deletions starlette/testclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ def __init__(
root_path: str = "",
backend: str = "asyncio",
backend_options: typing.Optional[typing.Dict[str, typing.Any]] = None,
cookies: httpx._client.CookieTypes = None,
cookies: httpx._types.CookieTypes = None,
headers: typing.Dict[str, str] = None,
) -> None:
self.async_backend = _AsyncBackend(
Expand Down Expand Up @@ -464,7 +464,7 @@ def request( # type: ignore[override]
follow_redirects: typing.Optional[bool] = None,
allow_redirects: typing.Optional[bool] = None,
timeout: typing.Union[
httpx._client.TimeoutTypes, httpx._client.UseClientDefault
httpx._types.TimeoutTypes, httpx._client.UseClientDefault
] = httpx._client.USE_CLIENT_DEFAULT,
extensions: typing.Optional[typing.Dict[str, typing.Any]] = None,
) -> httpx.Response:
Expand Down Expand Up @@ -499,7 +499,7 @@ def get( # type: ignore[override]
follow_redirects: typing.Optional[bool] = None,
allow_redirects: typing.Optional[bool] = None,
timeout: typing.Union[
httpx._client.TimeoutTypes, httpx._client.UseClientDefault
httpx._types.TimeoutTypes, httpx._client.UseClientDefault
] = httpx._client.USE_CLIENT_DEFAULT,
extensions: typing.Optional[typing.Dict[str, typing.Any]] = None,
) -> httpx.Response:
Expand Down Expand Up @@ -528,7 +528,7 @@ def options( # type: ignore[override]
follow_redirects: typing.Optional[bool] = None,
allow_redirects: typing.Optional[bool] = None,
timeout: typing.Union[
httpx._client.TimeoutTypes, httpx._client.UseClientDefault
httpx._types.TimeoutTypes, httpx._client.UseClientDefault
] = httpx._client.USE_CLIENT_DEFAULT,
extensions: typing.Optional[typing.Dict[str, typing.Any]] = None,
) -> httpx.Response:
Expand Down Expand Up @@ -557,7 +557,7 @@ def head( # type: ignore[override]
follow_redirects: typing.Optional[bool] = None,
allow_redirects: typing.Optional[bool] = None,
timeout: typing.Union[
httpx._client.TimeoutTypes, httpx._client.UseClientDefault
httpx._types.TimeoutTypes, httpx._client.UseClientDefault
] = httpx._client.USE_CLIENT_DEFAULT,
extensions: typing.Optional[typing.Dict[str, typing.Any]] = None,
) -> httpx.Response:
Expand Down Expand Up @@ -590,7 +590,7 @@ def post( # type: ignore[override]
follow_redirects: typing.Optional[bool] = None,
allow_redirects: typing.Optional[bool] = None,
timeout: typing.Union[
httpx._client.TimeoutTypes, httpx._client.UseClientDefault
httpx._types.TimeoutTypes, httpx._client.UseClientDefault
] = httpx._client.USE_CLIENT_DEFAULT,
extensions: typing.Optional[typing.Dict[str, typing.Any]] = None,
) -> httpx.Response:
Expand Down Expand Up @@ -627,7 +627,7 @@ def put( # type: ignore[override]
follow_redirects: typing.Optional[bool] = None,
allow_redirects: typing.Optional[bool] = None,
timeout: typing.Union[
httpx._client.TimeoutTypes, httpx._client.UseClientDefault
httpx._types.TimeoutTypes, httpx._client.UseClientDefault
] = httpx._client.USE_CLIENT_DEFAULT,
extensions: typing.Optional[typing.Dict[str, typing.Any]] = None,
) -> httpx.Response:
Expand Down Expand Up @@ -664,7 +664,7 @@ def patch( # type: ignore[override]
follow_redirects: typing.Optional[bool] = None,
allow_redirects: typing.Optional[bool] = None,
timeout: typing.Union[
httpx._client.TimeoutTypes, httpx._client.UseClientDefault
httpx._types.TimeoutTypes, httpx._client.UseClientDefault
] = httpx._client.USE_CLIENT_DEFAULT,
extensions: typing.Optional[typing.Dict[str, typing.Any]] = None,
) -> httpx.Response:
Expand Down Expand Up @@ -697,7 +697,7 @@ def delete( # type: ignore[override]
follow_redirects: typing.Optional[bool] = None,
allow_redirects: typing.Optional[bool] = None,
timeout: typing.Union[
httpx._client.TimeoutTypes, httpx._client.UseClientDefault
httpx._types.TimeoutTypes, httpx._client.UseClientDefault
] = httpx._client.USE_CLIENT_DEFAULT,
extensions: typing.Optional[typing.Dict[str, typing.Any]] = None,
) -> httpx.Response:
Expand Down

0 comments on commit 8811c1c

Please sign in to comment.