From a6c01e051ea0f8e8acdfa40799d1b59ab2e885e8 Mon Sep 17 00:00:00 2001 From: apex-mochen <2756823972@qq.com> Date: Fri, 9 Oct 2026 00:26:18 +0800 Subject: [PATCH] fix(tests): move TQ002 exemptions onto the reported lines Place the test-quality-ok exemptions for the #44504 regression tests on the def line itself, matching the repo convention that a suppression sits on the reported line. Signed-off-by: apex-mochen <2756823972@qq.com> --- tests/unit/integrations/test_opentelemetry.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/unit/integrations/test_opentelemetry.py b/tests/unit/integrations/test_opentelemetry.py index ec4f3bc3789..5f75f2309a2 100644 --- a/tests/unit/integrations/test_opentelemetry.py +++ b/tests/unit/integrations/test_opentelemetry.py @@ -7341,8 +7341,7 @@ class TestOpenTelemetryRawSpanRespectsRedaction(unittest.TestCase): """ @patch.dict(os.environ, {"OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT": ""}) - def test_skips_raw_span_when_redaction_header_set(self): - # test-quality-ok: negative-path test; the observable behavior is precisely that no raw span is created, which is only assertable on the tracer mock + def test_skips_raw_span_when_redaction_header_set(self): # test-quality-ok: negative-path test; the observable behavior is precisely that no raw span is created, which is only assertable on the tracer mock """Redaction requested via the per-request header -> raw span is not created.""" from litellm.integrations.opentelemetry import OpenTelemetry @@ -7362,8 +7361,7 @@ class TestOpenTelemetryRawSpanRespectsRedaction(unittest.TestCase): otel.set_raw_request_attributes.assert_not_called() @patch.dict(os.environ, {"OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT": ""}) - def test_creates_raw_span_when_no_redaction_requested(self): - # test-quality-ok: positive-path twin of the test above; asserts the span name and raw-attribute hook via the tracer mock, matching the existing file style + def test_creates_raw_span_when_no_redaction_requested(self): # test-quality-ok: positive-path twin of the test above; asserts the span name and raw-attribute hook via the tracer mock, matching the existing file style """No redaction requested (empty headers dict) -> raw span is still created.""" from litellm.integrations.opentelemetry import RAW_REQUEST_SPAN_NAME, OpenTelemetry