# AssertionError: assert '' in 'Some stderr output'

- **ID:** `python/pytest-capsys-stderr-not-captured`
- **Domain:** python
- **Category:** config_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

The capsys fixture captures stdout but not stderr by default, or the test is using print to stderr incorrectly.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.x | active | — | — |

## Workarounds

1. **** (95% success)
   ```
   captured = capsys.readouterr()
assert 'expected' in captured.err
   ```
2. **** (90% success)
   ```
   def test_foo(capfd):
    print('stderr', file=sys.stderr)
    captured = capfd.readouterr()
    assert 'stderr' in captured.err
   ```

## Dead Ends

- **** — capfd captures file descriptors, which may not be what you want. (60% fail)
- **** — This doesn't affect capture. (80% fail)
