Skip to content

Conversation

@Pouyanpi
Copy link
Collaborator

@Pouyanpi Pouyanpi commented Dec 1, 2025

The DEBUG level was flooding test output with verbose nemoguardrails logs,making it difficult to read test results.

  • Changed default pytest log level from DEBUG to WARNING to reduce noise in test output
  • Verbose logging can still be enabled per-request using --log-level=DEBUG or --log-level=INFO
  • Fixed test that checks INFO-level log messages to explicitly set caplog.set_level(logging.INFO)

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`.
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Dec 1, 2025

Greptile Overview

Greptile Summary

Changed default pytest log level from DEBUG to WARNING to reduce verbose test output. This is a sensible change that will make test results more readable.

  • The change correctly updates the log_level configuration in pytest.ini
  • Users can still enable verbose logging with --log-level=DEBUG when needed
  • Note: Some test files have hardcoded logging.basicConfig(level=logging.DEBUG) which may override this setting for those specific test modules

Confidence Score: 4/5

  • This PR is safe to merge with minimal risk
  • The change is simple, well-justified, and improves test output readability. Score is 4 rather than 5 because some test files have hardcoded DEBUG logging that may reduce the effectiveness of this change
  • No files require special attention - this is a straightforward configuration change

Important Files Changed

File Analysis

Filename Score Overview
pytest.ini 4/5 Changed default log level from DEBUG to WARNING to reduce test output verbosity

Sequence Diagram

sequenceDiagram
    participant Dev as Developer
    participant Pytest as Pytest
    participant Config as pytest.ini
    participant Tests as Test Files
    participant Logger as Python Logging

    Dev->>Pytest: Run pytest
    Pytest->>Config: Read log_level = WARNING
    Pytest->>Logger: Configure pytest logging handler
    Logger->>Logger: Set level to WARNING
    Pytest->>Tests: Import test modules
    Note over Tests,Logger: Some tests have logging.basicConfig(level=DEBUG)
    Tests->>Logger: Configure basicConfig (may override pytest setting)
    Pytest->>Tests: Execute test functions
    Tests->>Logger: Emit log messages
    Logger->>Dev: Display logs (WARNING+ only, unless overridden)
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 file reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@Pouyanpi Pouyanpi self-assigned this Dec 1, 2025
@codecov
Copy link

codecov bot commented Dec 1, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants