# AssertionError: assert 'hello' in ''

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

## Root Cause

capsys fixture未正确捕获stdout，通常因为输出被缓冲或使用了错误的捕获模式。

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.6 | active | — | — |

## Workarounds

1. **** (95% success)
   ```
   def test_output(capsys):
    print('hello')
    captured = capsys.readouterr()
    assert 'hello' in captured.out
   ```
2. **** (90% success)
   ```
   def test_output(capfd):
    print('hello')
    captured = capfd.readouterr()
    assert 'hello' in captured.out
   ```

## Dead Ends

- **** — print输出可能被capsys捕获，但断言失败说明捕获内容为空。 (80% fail)
- **** — 与print类似，可能仍被捕获。 (90% fail)
