# AssertionError: assert 'expected message' in []
# caplog.records is empty

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

## Root Cause

The logger's propagate flag is False, or the code uses a logger configured with a custom handler and propagate=False, so records never reach the root logger that caplog attaches to.

## Version Compatibility

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

## Workarounds

1. **** (92% success)
   ```
   def test_logs(caplog):
    logging.getLogger('mypkg').propagate = True
    with caplog.at_level(logging.INFO, logger='mypkg'):
        mypkg.do_work()
    assert 'expected message' in caplog.text
   ```
2. **** (85% success)
   ```
   def test_logs(caplog):
    logger = logging.getLogger('mypkg')
    logger.addHandler(caplog.handler)
    mypkg.do_work()
    assert 'expected message' in caplog.text
   ```

## Dead Ends

- **** — Adjusts the level but does not change propagate; the record still never reaches caplog's handler. (70% fail)
- **** — Adds a root handler but does not affect the child logger's propagate=False setting. (80% fail)
