From 23140fab2f2d27eb00063243bc39f646bbd240af Mon Sep 17 00:00:00 2001 From: Shin Date: Sat, 7 Feb 2026 17:46:20 +0000 Subject: [PATCH] fix(tests): Use uuid for unique model name in scientific notation test The test was using a static "unique" model name which could cause conflicts when running tests in parallel (-n 16 in CI). Using uuid ensures truly unique names to prevent test pollution. --- tests/test_litellm/test_utils.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/tests/test_litellm/test_utils.py b/tests/test_litellm/test_utils.py index ee23811d5ac..71e043eb22a 100644 --- a/tests/test_litellm/test_utils.py +++ b/tests/test_litellm/test_utils.py @@ -2283,18 +2283,14 @@ def test_register_model_with_scientific_notation(): """ Test that the register_model function can handle scientific notation in the model name. """ - # Use a unique model name to avoid conflicts with other tests - test_model_name = "test-scientific-notation-model-unique-12345" + import uuid - # Clean up any pre-existing entry and clear caches - if test_model_name in litellm.model_cost: - del litellm.model_cost[test_model_name] + # Use a truly unique model name with uuid to avoid conflicts when tests run in parallel + test_model_name = f"test-scientific-notation-model-{uuid.uuid4().hex[:12]}" # Clear LRU caches that might have stale data from litellm.utils import ( - _cached_get_model_info_helper, _invalidate_model_cost_lowercase_map, - get_model_info, ) _invalidate_model_cost_lowercase_map()