# AssertionError: assert 'user created' in []
  where [] = caplog.messages

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

## Root Cause

caplog only captures records at WARNING or above by default when the root logger has no handler configured, or the application uses a custom logger with propagate=False. Propagation must be enabled for caplog to intercept records.

## Version Compatibility

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

## Workarounds

1. **** (95% success)
   ```
   def test_create_user(caplog):
    caplog.set_level(logging.INFO, logger='myapp')
    create_user('a@b.com')
    assert 'user created' in caplog.text

# in myapp/__init__.py
logger = logging.getLogger('myapp')
logger.propagate = True
   ```
2. **** (93% success)
   ```
   def test_create_user(caplog):
    with caplog.at_level(logging.INFO, logger='myapp'):
        create_user('a@b.com')
    assert any('user created' in r.message for r in caplog.records)
   ```

## Dead Ends

- **** — Clearing removes whatever was captured; if nothing was captured to begin with, the list stays empty. (90% fail)
- **** — Logging does not necessarily write to stdout; the logger may use a file or syslog handler, so capsys captures nothing. (85% fail)
