Skip to content

structlog output is not captured by pytest caplog — log assertions fail suite-wide #66

Description

@Aburke225

The application logs through structlog, which is not configured to propagate into the stdlib logging system during tests. Every test asserting on caplog (e.g. test_empty_chunks_list_returns_empty in tests/unit/test_batch_processor.py) fails even though the code under test does emit the expected log event. Configure structlog in tests/conftest.py (e.g. via structlog.stdlib processors or capture_logs) so caplog-based assertions work.

Steps to reproduce: pytest tests/unit/test_batch_processor.py::TestBatchEmbeddingProcessor::test_empty_chunks_list_returns_empty -q — observed: assertion on caplog fails while the warning is visibly printed to stderr.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtestsTest coveragetier-1Starter difficulty

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions