From 11a774e1103ede483dac4ed37d2cdf270cc5cfeb Mon Sep 17 00:00:00 2001 From: Julio Quinteros Pro Date: Mon, 23 Feb 2026 13:27:13 -0300 Subject: [PATCH 1/3] 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 --- tests/test_litellm/test_utils.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/test_litellm/test_utils.py b/tests/test_litellm/test_utils.py index 984c6b0117..35cb290fcc 100644 --- a/tests/test_litellm/test_utils.py +++ b/tests/test_litellm/test_utils.py @@ -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) From a74b6eee23490518a5b6c9ff7a06618af198926a Mon Sep 17 00:00:00 2001 From: Julio Quinteros Pro Date: Mon, 23 Feb 2026 13:38:16 -0300 Subject: [PATCH 2/3] Update tests/test_litellm/test_utils.py Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --- tests/test_litellm/test_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_litellm/test_utils.py b/tests/test_litellm/test_utils.py index 35cb290fcc..d4e3703f06 100644 --- a/tests/test_litellm/test_utils.py +++ b/tests/test_litellm/test_utils.py @@ -808,7 +808,7 @@ def test_aaamodel_prices_and_context_window_json_is_valid(): }, } - prod_json = os.path.join(os.path.dirname(__file__), "..", "..", "model_prices_and_context_window.json") + prod_json = Path(__file__).parent.parent.parent / "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) From bf8c21986092813af1ab721bff837196b80e563c Mon Sep 17 00:00:00 2001 From: Julio Quinteros Pro Date: Mon, 23 Feb 2026 13:56:11 -0300 Subject: [PATCH 3/3] fix(tests): use os.path instead of Path to avoid NameError Path is not imported at module level. Use os.path.join which is already available. Co-Authored-By: Claude Opus 4.6 --- tests/test_litellm/test_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_litellm/test_utils.py b/tests/test_litellm/test_utils.py index d4e3703f06..35cb290fcc 100644 --- a/tests/test_litellm/test_utils.py +++ b/tests/test_litellm/test_utils.py @@ -808,7 +808,7 @@ def test_aaamodel_prices_and_context_window_json_is_valid(): }, } - prod_json = Path(__file__).parent.parent.parent / "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)