# AssertionError: assert 'starting' in capsys.readouterr().out
E       AssertionError: assert 'starting' in ''

- **ID:** `python/pytest-capture-log-with-caplog-and-capsys`
- **Domain:** python
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

The message was emitted via logging, not print, so capsys captured nothing. Logging writes to stderr through the logging handler, not stdout.

## Version Compatibility

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

## Workarounds

1. **** (95% success)
   ```
   def test_start(caplog):
    with caplog.at_level("INFO"):
        start()
    assert "starting" in caplog.text
   ```
2. **** (85% success)
   ```
   def test_start(capsys):
    start()
    captured = capsys.readouterr()
    assert "starting" in captured.err
   ```

## Dead Ends

- **** — Nothing was written to stdout in the first place. (90% fail)
- **** — Same stream issue; binary vs text doesn't help. (90% fail)
- **** — Pollutes production code to satisfy a test. (80% fail)
