From 8bb0ced311f991c0838d020cbf3ed97b591ec0ad Mon Sep 17 00:00:00 2001 From: Pouyanpi <13303554+Pouyanpi@users.noreply.github.com> Date: Mon, 1 Dec 2025 13:07:24 +0100 Subject: [PATCH 1/2] chore(test): reduce default pytest log level from DEBUG to WARNING The DEBUG level was flooding test output with verbose nemoguardrails logs,making it difficult to read test results. Users can still enable verbose logging when needed via `--log-level=DEBUG`. --- pytest.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pytest.ini b/pytest.ini index 9990248e9..6e29720ec 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,6 +1,6 @@ [pytest] addopts = -p no:warnings -log_level = DEBUG +log_level = WARNING # The flag below should only be activated in special debug sessions # i.e. the test hangs and we need to see what happened up to that point. From 993852f897dd69a0dc42a81b204446e47a86084e Mon Sep 17 00:00:00 2001 From: Pouyanpi <13303554+Pouyanpi@users.noreply.github.com> Date: Mon, 1 Dec 2025 13:21:56 +0100 Subject: [PATCH 2/2] Updated test that relies on INFO-level log capture to explicitly set caplog level. --- tests/test_jailbreak_actions.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/test_jailbreak_actions.py b/tests/test_jailbreak_actions.py index 66c492ae5..bd8c74661 100644 --- a/tests/test_jailbreak_actions.py +++ b/tests/test_jailbreak_actions.py @@ -229,6 +229,9 @@ async def test_jailbreak_detection_model_local_import_error(self, monkeypatch, c @pytest.mark.asyncio async def test_jailbreak_detection_model_local_success(self, monkeypatch, caplog): """Test successful local model execution.""" + import logging + + caplog.set_level(logging.INFO) from nemoguardrails.library.jailbreak_detection.actions import ( jailbreak_detection_model, )