| Conditions | 4 |
| Total Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | #!/usr/bin/env python |
||
| 10 | def test_python_tee_output(capsys): |
||
| 11 | expected_lines = { |
||
| 12 | "captured stdout", |
||
| 13 | "captured stderr"} |
||
| 14 | |||
| 15 | capture_stdout = get_stdcapturer("PY") |
||
| 16 | with capsys.disabled(): |
||
| 17 | print('before (stdout)') |
||
| 18 | print('before (stderr)') |
||
| 19 | with capture_stdout() as (f, final_out): |
||
| 20 | print("captured stdout") |
||
| 21 | print("captured stderr") |
||
| 22 | |||
| 23 | print('after (stdout)') |
||
| 24 | print('after (stderr)') |
||
| 25 | |||
| 26 | assert set(final_out[0].strip().split("\n")) == expected_lines |
||
| 27 | |||
| 54 |