mirror of
https://github.com/BerriAI/litellm.git
synced 2026-08-28 05:25:59 +00:00
Fix isinstance() checks failing due to module reload in conftest.py. The conftest.py fixture reloads the litellm module between test modules, which causes class references imported at module-level to become stale. When AsyncHTTPHandler is imported at the top of the file and then litellm is reloaded by the fixture, the isinstance() check fails because the returned instance is of the NEW AsyncHTTPHandler class while the test is checking against the OLD class reference. Solution: Import AsyncHTTPHandler locally within each test function that uses isinstance() checks. This ensures we get the fresh class reference after the module reload. Fixed tests: - test_session_reuse_integration - test_get_async_httpx_client_with_shared_session - test_get_async_httpx_client_without_shared_session This resolves intermittent CI failures where parallel test execution triggers the module reload behavior. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| test_aiohttp_handler.py | ||
| test_aiohttp_transport.py | ||
| test_gemini_session_leak.py | ||
| test_http_handler.py | ||
| test_llm_http_handler.py | ||