test RichOutput.display This is a bit circular, because we are actually using the capture code we are testing to test itself.
()
| 100 | yield nt.assert_equal, getattr(rich, method)(), (data[mime], metadata[mime]) |
| 101 | |
| 102 | def test_rich_output_display(): |
| 103 | """test RichOutput.display |
| 104 | |
| 105 | This is a bit circular, because we are actually using the capture code we are testing |
| 106 | to test itself. |
| 107 | """ |
| 108 | data = full_data |
| 109 | rich = capture.RichOutput(data=data) |
| 110 | with capture.capture_output() as cap: |
| 111 | rich.display() |
| 112 | yield nt.assert_equal, len(cap.outputs), 1 |
| 113 | rich2 = cap.outputs[0] |
| 114 | yield nt.assert_equal, rich2.data, rich.data |
| 115 | yield nt.assert_equal, rich2.metadata, rich.metadata |
| 116 | |
| 117 | def test_capture_output(): |
| 118 | """capture_output works""" |