# AssertionError: assert 'expected log' in ''

- **ID:** `python/pytest-caplog-no-output`
- **Domain:** python
- **Category:** data_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

The logger's level is higher than the message level, or logging was configured with propagate=False, so caplog does not capture the record. caplog defaults to WARNING.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 7.x | active | — | — |
| 8.x | active | — | — |

## Workarounds

1. **** (93% success)
   ```
   def test_logs(caplog):
    caplog.set_level(logging.INFO, logger='app')
    do_work()
    assert 'expected log' in caplog.text

# app/logger.py
logger = logging.getLogger('app')
logger.propagate = True
   ```
2. **** (90% success)
   ```
   def test_logs(caplog):
    caplog.set_level(logging.INFO)
    do_work()
    assert any(r.message == 'expected log' for r in caplog.records)
   ```

## Dead Ends

- **** — -s disables output capture, which actually makes caplog less likely to see logs from some handlers. (70% fail)
- **** — May add a handler but caplog still relies on propagation and its own level; often ineffective. (65% fail)
