From ced880fa6226daedf252c9b3d929cbc4165f55a5 Mon Sep 17 00:00:00 2001 From: STiFLeR7 Date: Fri, 11 Sep 2026 10:15:26 +0530 Subject: [PATCH] test(a2a): drop no-op sys.path.insert from new regression tests pytest's rootdir handling and the installed package already make litellm importable; these were copy-paste no-ops that also made the guardrail_translation test's imports depend on the working directory it happens to run from. Resolves the TQ003 test-quality budget breach flagged in the lint job. --- .../a2a_protocol/test_regression_issue_28577.py | 8 -------- .../llms/a2a/chat/guardrail_translation/test_handler.py | 4 ---- .../test_litellm/responses/test_regression_issue_28553.py | 8 -------- 3 files changed, 20 deletions(-) diff --git a/tests/test_litellm/a2a_protocol/test_regression_issue_28577.py b/tests/test_litellm/a2a_protocol/test_regression_issue_28577.py index 88292f907cf..ae8b670083d 100644 --- a/tests/test_litellm/a2a_protocol/test_regression_issue_28577.py +++ b/tests/test_litellm/a2a_protocol/test_regression_issue_28577.py @@ -1,11 +1,3 @@ -import sys -import os - -# Add litellm to sys.path -sys.path.insert( - 0, os.path.abspath(os.path.join(os.path.dirname(__file__), "../../../")) -) - from litellm.llms.a2a.chat.transformation import A2AConfig from litellm.llms.a2a.common_utils import extract_text_from_a2a_message diff --git a/tests/test_litellm/llms/a2a/chat/guardrail_translation/test_handler.py b/tests/test_litellm/llms/a2a/chat/guardrail_translation/test_handler.py index 9af0bae00c1..150538f1d2c 100644 --- a/tests/test_litellm/llms/a2a/chat/guardrail_translation/test_handler.py +++ b/tests/test_litellm/llms/a2a/chat/guardrail_translation/test_handler.py @@ -9,14 +9,10 @@ inspected `kind: "text"` parts, so guarded output checks were skipped for that content path. """ -import os -import sys from typing import Any, Literal, Optional import pytest -sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "../../../../../.."))) - from litellm.integrations.custom_guardrail import CustomGuardrail from litellm.llms.a2a.chat.guardrail_translation.handler import A2AGuardrailHandler from litellm.types.utils import GenericGuardrailAPIInputs diff --git a/tests/test_litellm/responses/test_regression_issue_28553.py b/tests/test_litellm/responses/test_regression_issue_28553.py index f07b1523d97..a621154c5f9 100644 --- a/tests/test_litellm/responses/test_regression_issue_28553.py +++ b/tests/test_litellm/responses/test_regression_issue_28553.py @@ -1,11 +1,3 @@ -import sys -import os - -# Add litellm to sys.path -sys.path.insert( - 0, os.path.abspath(os.path.join(os.path.dirname(__file__), "../../../")) -) - from litellm.proxy.common_request_processing import ProxyBaseLLMRequestProcessing