# AssertionError: assert 'Hello' in '' (captured stdout is empty)

- **ID:** `python/pytest-capture-stdout-assertion`
- **Domain:** python
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

测试期望捕获标准输出，但被测代码未打印任何内容，或输出被重定向。

## Version Compatibility

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

## Workarounds

1. **** (90% success)
   ```
   确保代码中有 print 或 logging 输出，且使用 capsys 捕获。
   ```
2. **** (95% success)
   ```
   在测试中调用 `out, err = capsys.readouterr()` 获取输出并断言。
   ```

## Dead Ends

- **** — 修改被测代码，且可能不满足测试意图。 (70% fail)
- **** — 如果代码本身没有输出，flush 无效。 (60% fail)
