fastmcp/tests/client
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
..
auth feat: add Static Client Registration (#3085) (#3086) 2026-02-09 20:40:06 -05:00
client Propagate x-fastmcp-wrap-result in tool result _meta (#3490) 2026-03-14 11:09:46 -04:00
sampling Add Google GenAI Sampling Handler (#2977) 2026-03-02 18:00:03 -05:00
tasks Expose minimum_check_interval, reduce task pickup latency (#3500) 2026-03-14 16:08:28 -04:00
telemetry Fix ty 0.0.17 diagnostics and bump lockfile 2026-02-16 16:13:38 -05:00
transports fix: remove forced follow_redirects from httpx_client_factory calls (#3496) 2026-03-15 11:30:41 -04:00
__init__.py clean up test inits 2025-05-31 19:32:08 -04:00
test_elicitation.py Split large test files to comply with loq line limit (#3328) 2026-02-28 11:21:11 -05:00
test_elicitation_enums.py Split large test files to comply with loq line limit (#3328) 2026-02-28 11:21:11 -05:00
test_logs.py Support logging/setLevel and add client_log_level setting (#3491) 2026-03-14 10:36:01 -04:00
test_notifications.py Remove sync notification infrastructure 2026-01-18 17:31:11 -05:00
test_oauth_callback_race.py Guard OAuth callback result from post-completion overwrites (#3417) 2026-03-07 11:41:00 -05:00
test_oauth_callback_xss.py Escape all HTML to prevent XSS attack (#2090) 2025-10-14 12:30:21 -07:00
test_openapi.py Move OpenAPI to providers/openapi submodule (#2672) 2025-12-22 11:13:33 -05:00
test_progress.py Guard default progress handler against zero totals (#3432) 2026-03-07 11:41:11 -05:00
test_roots.py Add structured content & update almost all tests 2025-06-27 15:40:52 -04:00
test_sampling.py Split large test files to comply with loq line limit (#3328) 2026-02-28 11:21:11 -05:00
test_sampling_result_types.py Split large test files to comply with loq line limit (#3328) 2026-02-28 11:21:11 -05:00
test_sampling_tool_loop.py Split large test files to comply with loq line limit (#3328) 2026-02-28 11:21:11 -05:00
test_sse.py Bump tool sleep to actually validate timeout precedence 2026-03-02 13:50:29 -05:00
test_stdio.py perf: reduce PBKDF2 iterations in tests, fix warnings and timeouts (#3504) 2026-03-14 16:42:06 -04:00
test_streamable_http.py Fix ty 0.0.17 diagnostics and bump lockfile 2026-02-16 16:13:38 -05:00