mirror of
https://github.com/tiennm99/litellm.git
synced 2026-07-14 20:22:20 +00:00
40edb16fb9
The eager tiktoken tests were clearing all litellm modules from sys.modules and re-importing, creating new module objects with different class identities. This broke unittest.mock.patch for all subsequent tests on the same xdist worker. Running these tests in subprocesses provides perfect isolation. Fixes: test_metadata_passed_to_custom_callback_codex_models, test_oidc_github_success, test_oidc_google_cached, test_oidc_google_failure, test_encrypted_content_affinity_bypasses_rpm_limits, and 5 others. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Testing for litellm/
This directory 1:1 maps the the litellm/ directory, and can only contain mocked tests.
The point of this is to:
- Increase test coverage of
litellm/ - Make it easy for contributors to add tests for the
litellm/package and easily run tests without needing LLM API keys.
File name conventions
litellm/proxy/test_caching_routes.pymaps tolitellm/proxy/caching_routes.pytest_<filename>.pymaps tolitellm/<filename>.py