litellm/tests/test_litellm/llms/huggingface
Mateo Wang 9ab3847c0b
fix(tests): remove importlib.reload of http_handler that breaks client injection in later tests (#34336)
The huggingface embedding test fixture reloaded
litellm.llms.custom_httpx.http_handler, creating a new HTTPHandler class
object. llm_http_handler keeps the class captured at import time, so any
test running later in the same process that injects a client built from
the reloaded class fails the isinstance check and the mock is silently
discarded, causing a real network call. Under pytest-xdist loadscope this
surfaced as a deterministic failure of
test_accept_header_in_completion_request_jwt whenever an unrelated PR
shifted worker distribution.

Also removes the same reload pattern from the vertex rerank integration
test (both were previously removed in a6df01caec and resurrected by a
merge conflict resolution) and hardens the agentcore victim test by
dropping the bare except that swallowed the real error
2026-07-23 01:11:35 +00:00
..
embedding fix(tests): remove importlib.reload of http_handler that breaks client injection in later tests (#34336) 2026-07-23 01:11:35 +00:00
rerank style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
__init__.py feat: add HuggingFace rerank provider support (#11438) 2025-06-05 23:23:01 -07:00