# AssertionError: assert 'hello' in ''
  where '' = capsys.readouterr().out

- **ID:** `python/pytest-capsys-no-output`
- **Domain:** python
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

capsys only captures sys.stdout/sys.stderr writes. Code that uses logging, os.write(1, ...), or a C extension writing to fd 1 bypasses Python's sys.stdout and is not captured.

## Version Compatibility

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

## Workarounds

1. **** (95% success)
   ```
   Use caplog for logging output:

def test_log(caplog):
    logging.getLogger(__name__).warning('hello')
    assert 'hello' in caplog.text
   ```
2. **** (92% success)
   ```
   Use capfd for file-descriptor-level output:

def test_fd(capfd):
    os.write(1, b'hello')
    out, err = capfd.readouterr()
    assert 'hello' in out
   ```

## Dead Ends

- **** — readouterr() drains the buffer; the second call returns empty strings. (90% fail)
- **** — Mixing fixtures means output goes to the fd-level buffer while the test reads the sys-level buffer. (85% fail)
