# AssertionError: assert 'expected message' in []

- **ID:** `python/pytest-caplog-not-capturing`
- **Domain:** python
- **Category:** config_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

The caplog fixture did not capture any log records because the logger's level is higher than the log message level, or the logger is not propagating to the root logger.

## Version Compatibility

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

## Workarounds

1. **** (92% success)
   ```
   def test_logging(caplog):
    caplog.set_level(logging.INFO)
    my_function()
    assert 'expected message' in caplog.text
   ```
2. **** (88% success)
   ```
   logger = logging.getLogger('myapp')
logger.propagate = True
# Or use caplog.set_level with the specific logger name
   ```

## Dead Ends

- **** — The level must be set before the log call. Setting it after has no effect on already-emitted records. (85% fail)
- **** — This bypasses the logging system entirely and does not test the actual logging behavior. It also clutters test output. (70% fail)
