]> git.ipfire.org Git - thirdparty/starlette.git/commitdiff
what about now do-not-rely-on-httpx-private 3060/head
authorMarcelo Trylesinski <marcelotryle@gmail.com>
Sat, 1 Nov 2025 14:57:06 +0000 (15:57 +0100)
committerMarcelo Trylesinski <marcelotryle@gmail.com>
Sat, 1 Nov 2025 14:57:06 +0000 (15:57 +0100)
starlette/testclient.py

index 91725d1ec14962535911a93ed4b93266a2285ebe..f348b96a7223d320f1c26abef578818154ac803e 100644 (file)
@@ -487,7 +487,8 @@ class TestClient(httpx.Client):
         timeout: _WithDefault[_TimeoutTypes] = USE_CLIENT_DEFAULT,
         extensions: dict[str, Any] | None = None,
     ) -> httpx.Response:
-        if timeout is not USE_CLIENT_DEFAULT:
+        _timeout = _normalize_client_default(timeout)
+        if _timeout is not httpx.USE_CLIENT_DEFAULT:
             warnings.warn(
                 "You should not use the 'timeout' argument with the TestClient. "
                 "See https://github.com/Kludex/starlette/issues/1108 for more information.",
@@ -506,7 +507,7 @@ class TestClient(httpx.Client):
             cookies=cookies,
             auth=_normalize_client_default(auth),
             follow_redirects=_normalize_client_default(follow_redirects),
-            timeout=_normalize_client_default(timeout),
+            timeout=_timeout,
             extensions=extensions,
         )