fastmcp/tests/client/transports
Jeremiah Lowin 226bfb49fa
fix: remove forced follow_redirects from httpx_client_factory calls (#3496)
* fix: stop passing follow_redirects to httpx_client_factory

Remove the `follow_redirects=True` kwarg that was being forced onto
custom httpx_client_factory calls with a type: ignore suppression.
The McpHttpClientFactory protocol does not include follow_redirects,
so this was a protocol violation. httpx already strips Authorization
headers on cross-origin redirects via its _redirect_headers mechanism.

🤖 Co-authored-by: Claude <noreply@anthropic.com>

* fix: restore follow_redirects=True for custom httpx client factories

httpx already strips Authorization headers on cross-origin redirects,
so follow_redirects is safe to keep. Removing it broke redirect
handling for users providing custom factories.

* fix: remove vacuous test that never invoked connect_session

The test asserted on received_kwargs but never called connect_session,
so the factory was never invoked and the assertion was a no-op.

* fix: use AsyncClient with transport= instead of monkey-patching _transport
2026-03-15 11:30:41 -04:00
..
__init__.py Add UV Transport (#1270) 2025-07-28 15:41:36 -04:00
test_memory_transport.py fix: task test teardown hanging 5s per test (#3499) 2026-03-14 15:33:44 -04:00
test_no_redirect.py fix: remove forced follow_redirects from httpx_client_factory calls (#3496) 2026-03-15 11:30:41 -04:00
test_transports.py Add verify parameter for SSL certificate configuration (#3487) 2026-03-14 11:48:32 -04:00
test_uv_transport.py Increase uv transport test timeout to 60s for cold-start CI 2026-03-03 16:49:40 -05:00