Skip to content

Commit

Permalink
fix: change to request function
Browse files Browse the repository at this point in the history
  • Loading branch information
iudeen committed Jan 4, 2025
1 parent 77117ab commit 8d211e7
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions starlette/testclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,8 @@ def request( # type: ignore[override]
timeout: httpx._types.TimeoutTypes | httpx._client.UseClientDefault = httpx._client.USE_CLIENT_DEFAULT,
extensions: dict[str, typing.Any] | None = None,
) -> httpx.Response:
if timeout is not httpx.USE_CLIENT_DEFAULT:
warnings.warn("The 'timeout' argument is not supported by 'TestClient'.", DeprecationWarning)
url = self._merge_url(url)
return super().request(
method,
Expand Down Expand Up @@ -456,8 +458,6 @@ def get( # type: ignore[override]
timeout: httpx._types.TimeoutTypes | httpx._client.UseClientDefault = httpx._client.USE_CLIENT_DEFAULT,
extensions: dict[str, typing.Any] | None = None,
) -> httpx.Response:
if timeout is not httpx.USE_CLIENT_DEFAULT:
warnings.warn("The 'timeout' argument is not supported by 'TestClient'.", DeprecationWarning)
return super().get(
url,
params=params,
Expand All @@ -481,8 +481,6 @@ def options( # type: ignore[override]
timeout: httpx._types.TimeoutTypes | httpx._client.UseClientDefault = httpx._client.USE_CLIENT_DEFAULT,
extensions: dict[str, typing.Any] | None = None,
) -> httpx.Response:
if timeout is not httpx.USE_CLIENT_DEFAULT:
warnings.warn("The 'timeout' argument is not supported by 'TestClient'.", DeprecationWarning)
return super().options(
url,
params=params,
Expand All @@ -506,8 +504,6 @@ def head( # type: ignore[override]
timeout: httpx._types.TimeoutTypes | httpx._client.UseClientDefault = httpx._client.USE_CLIENT_DEFAULT,
extensions: dict[str, typing.Any] | None = None,
) -> httpx.Response:
if timeout is not httpx.USE_CLIENT_DEFAULT:
warnings.warn("The 'timeout' argument is not supported by 'TestClient'.", DeprecationWarning)
return super().head(
url,
params=params,
Expand Down Expand Up @@ -535,8 +531,6 @@ def post( # type: ignore[override]
timeout: httpx._types.TimeoutTypes | httpx._client.UseClientDefault = httpx._client.USE_CLIENT_DEFAULT,
extensions: dict[str, typing.Any] | None = None,
) -> httpx.Response:
if timeout is not httpx.USE_CLIENT_DEFAULT:
warnings.warn("The 'timeout' argument is not supported by 'TestClient'.", DeprecationWarning)
return super().post(
url,
content=content,
Expand Down Expand Up @@ -568,8 +562,6 @@ def put( # type: ignore[override]
timeout: httpx._types.TimeoutTypes | httpx._client.UseClientDefault = httpx._client.USE_CLIENT_DEFAULT,
extensions: dict[str, typing.Any] | None = None,
) -> httpx.Response:
if timeout is not httpx.USE_CLIENT_DEFAULT:
warnings.warn("The 'timeout' argument is not supported by 'TestClient'.", DeprecationWarning)
return super().put(
url,
content=content,
Expand Down Expand Up @@ -601,8 +593,6 @@ def patch( # type: ignore[override]
timeout: httpx._types.TimeoutTypes | httpx._client.UseClientDefault = httpx._client.USE_CLIENT_DEFAULT,
extensions: dict[str, typing.Any] | None = None,
) -> httpx.Response:
if timeout is not httpx.USE_CLIENT_DEFAULT:
warnings.warn("The 'timeout' argument is not supported by 'TestClient'.", DeprecationWarning)
return super().patch(
url,
content=content,
Expand Down Expand Up @@ -630,8 +620,6 @@ def delete( # type: ignore[override]
timeout: httpx._types.TimeoutTypes | httpx._client.UseClientDefault = httpx._client.USE_CLIENT_DEFAULT,
extensions: dict[str, typing.Any] | None = None,
) -> httpx.Response:
if timeout is not httpx.USE_CLIENT_DEFAULT:
warnings.warn("The 'timeout' argument is not supported by 'TestClient'.", DeprecationWarning)
return super().delete(
url,
params=params,
Expand Down

0 comments on commit 8d211e7

Please sign in to comment.