Skip to content

Commit 65d3f2a

Browse files
authored
chore(test): reduce default pytest log level from DEBUG to WARNING (#1523)
* 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`. * Updated test that relies on INFO-level log capture to explicitly set caplog level.
1 parent 30f61b2 commit 65d3f2a

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

pytest.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[pytest]
22
addopts = -p no:warnings
3-
log_level = DEBUG
3+
log_level = WARNING
44

55
# The flag below should only be activated in special debug sessions
66
# i.e. the test hangs and we need to see what happened up to that point.

tests/test_jailbreak_actions.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,9 @@ async def test_jailbreak_detection_model_local_import_error(self, monkeypatch, c
229229
@pytest.mark.asyncio
230230
async def test_jailbreak_detection_model_local_success(self, monkeypatch, caplog):
231231
"""Test successful local model execution."""
232+
import logging
233+
234+
caplog.set_level(logging.INFO)
232235
from nemoguardrails.library.jailbreak_detection.actions import (
233236
jailbreak_detection_model,
234237
)

0 commit comments

Comments
 (0)