fix(tests): use absolute path for model_prices JSON in validation test

The test used a relative path 'litellm/model_prices_and_context_window.json'
which only works when pytest runs from a specific working directory.
Use os.path based on __file__ to resolve the path reliably.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Julio Quinteros Pro 2026-02-23 13:27:13 -03:00
parent ac6f2f3c52
commit 11a774e110

View File

@ -808,8 +808,7 @@ def test_aaamodel_prices_and_context_window_json_is_valid():
},
}
prod_json = "litellm/model_prices_and_context_window.json"
# prod_json = "../../model_prices_and_context_window.json"
prod_json = os.path.join(os.path.dirname(__file__), "..", "..", "model_prices_and_context_window.json")
with open(prod_json, "r") as model_prices_file:
actual_json = json.load(model_prices_file)
assert isinstance(actual_json, dict)