litellm/tests/test_litellm/llms/anthropic/chat/conftest.py
Cursor Agent 2cb3f0f027
refactor: remove unnecessary comments from #27074
Strip out the explanatory and historical comments that don't carry
business-logic justification. Comments that simply narrate what code
does — or that explain prior behavior, what was changed, or which PR
introduced a fix — are removed. Docstrings are reduced to a one-line
summary where the long form repeated information already evident from
the code or test data.

No code-behavior changes. All 643 affected unit tests still pass.

Co-authored-by: Mateo Wang <mateo-berri@users.noreply.github.com>
2026-05-04 19:34:56 +00:00

23 lines
738 B
Python

"""Force ``litellm.model_cost`` to load from the PR-local JSON for these tests.
By default ``litellm.model_cost`` is fetched from the main branch on GitHub,
which lags behind PR-branch flag additions. This fixture loads the local
file so per-model flag tests pass in CI as well as locally.
See https://github.com/BerriAI/litellm/issues/27122.
"""
import pytest
import litellm
from litellm.litellm_core_utils.get_model_cost_map import get_model_cost_map
@pytest.fixture(autouse=True)
def _use_pr_local_model_cost_map(monkeypatch):
monkeypatch.setenv("LITELLM_LOCAL_MODEL_COST_MAP", "True")
monkeypatch.setattr(
litellm,
"model_cost",
get_model_cost_map(url=litellm.model_cost_map_url),
)
yield