From b0c317e6d06d51127ea720d8000ae4a77069c145 Mon Sep 17 00:00:00 2001 From: michelligabriele Date: Mon, 16 Mar 2026 21:07:07 +0100 Subject: [PATCH] test: use __file__-relative sys.path for stable test imports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Address Greptile review — resolve sys.path relative to the test file location instead of the process working directory. --- tests/test_litellm/proxy/test_model_level_guardrails.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_litellm/proxy/test_model_level_guardrails.py b/tests/test_litellm/proxy/test_model_level_guardrails.py index f83ac8e59e2..d595b221328 100644 --- a/tests/test_litellm/proxy/test_model_level_guardrails.py +++ b/tests/test_litellm/proxy/test_model_level_guardrails.py @@ -12,7 +12,7 @@ import sys import pytest from unittest.mock import MagicMock, patch -sys.path.insert(0, os.path.abspath("../../..")) +sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "../../.."))) from litellm.proxy.utils import ( _check_and_merge_model_level_guardrails,