# AssertionError: assert 'user created' in ''
 +  where '' = caplog.text

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

## Root Cause

caplog captures records via the root logger handler, but the application logger has `propagate = False`, a custom handler with its own level, or the log level is higher than the emitted message.

## Version Compatibility

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

## Workarounds

1. **** (90% success)
   ```
   Force propagation and set level on the specific logger:
def test_create(caplog):
    caplog.set_level(logging.INFO, logger='myapp.users')
    create_user('alice')
    assert 'user created' in caplog.text
   ```
2. **** (82% success)
   ```
   If propagate is intentionally False, attach caplog's handler:
logger = logging.getLogger('myapp.users')
logger.addHandler(caplog.handler)
caplog.set_level(logging.INFO)
   ```

## Dead Ends

- **** — If propagate=False, records never reach caplog's handler regardless of level. (70% fail)
- **** — logger.info returns None; printing does not capture anything and the assertion still fails. (85% fail)
