capture_output works
()
| 115 | yield nt.assert_equal, rich2.metadata, rich.metadata |
| 116 | |
| 117 | def test_capture_output(): |
| 118 | """capture_output works""" |
| 119 | rich = capture.RichOutput(data=full_data) |
| 120 | with capture.capture_output() as cap: |
| 121 | print(hello_stdout, end="") |
| 122 | print(hello_stderr, end="", file=sys.stderr) |
| 123 | rich.display() |
| 124 | yield nt.assert_equal, hello_stdout, cap.stdout |
| 125 | yield nt.assert_equal, hello_stderr, cap.stderr |
| 126 | |
| 127 | def test_capture_output_no_stdout(): |
| 128 | """test capture_output(stdout=False)""" |