# test_output (tests.test_cli.TestCli) ... ok

(no captured stdout shown despite print() in the test)

- **ID:** `python/unittest-buffer-stdout-lost`
- **Domain:** python
- **Category:** config_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

unittest's buffer mode (`python -m unittest -b`) captures stdout/stderr and only prints it on failure; passing tests show nothing, so debugging prints are invisible.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.10 | active | — | — |
| 3.12 | active | — | — |

## Workarounds

1. **** (92% success)
   ```
   Disable buffering for the run:
python -m unittest -v tests.test_cli.TestCli
# or remove -b from the command / CI config
   ```
2. **** (88% success)
   ```
   Or capture stdout explicitly with contextlib.redirect_stdout:
import io, contextlib
buf = io.StringIO()
with contextlib.redirect_stdout(buf):
    run_cli(['--help'])
self.assertIn('usage', buf.getvalue())
   ```

## Dead Ends

- **** — stderr is also captured by buffer mode; still hidden on pass. (85% fail)
- **** — Turns the test red; not usable for debugging passing tests. (90% fail)
