From c281e4d9523876a26de1edd04ef7308a1d8d520d Mon Sep 17 00:00:00 2001 From: Sudhi Seshachala Date: Mon, 24 Aug 2026 17:10:57 -0500 Subject: [PATCH] test(conduct): skip smoke tests when conduct-litellm-guard not installed The wrapper module imports its runtime from the conduct-litellm-guard PyPI package. When the package is not installed in the CI environment, the smoke tests can't verify wiring (the import raises before any test runs). Use pytest.importorskip so BerriAI's default CI env doesn't fail on this integration, while environments that do install the package (via 'pip install conduct-litellm-guard[dev]' or similar) still get the smoke coverage. Full behavioural test coverage lives in the conduct-litellm-guard package's own CI. --- .../proxy/guardrails/test_conduct_guardrail.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/test_litellm/proxy/guardrails/test_conduct_guardrail.py b/tests/test_litellm/proxy/guardrails/test_conduct_guardrail.py index bae929d4e77..241d2063828 100644 --- a/tests/test_litellm/proxy/guardrails/test_conduct_guardrail.py +++ b/tests/test_litellm/proxy/guardrails/test_conduct_guardrail.py @@ -14,6 +14,14 @@ import sys import pytest +# The Conduct guardrail imports its runtime from `conduct-litellm-guard` +# on PyPI. When the package is not installed in the CI environment, +# skip — the wiring smoke tests only make sense against the real dep. +pytest.importorskip( + "conduct_litellm_guard", + reason="Install `conduct-litellm-guard` to test the Conduct guardrail integration.", +) + def test_import_module() -> None: """The wrapper module imports without side effects."""