Commit 9eee37a
Add positive-render coverage for display_data with text/plain fallback (R8 P3)
The extractor's shared `execute_result | display_data` branch in
`_format_output` renders `data["text/plain"]` for both output types, but
the prior tests only positively covered `execute_result` (in
`test_extractor_handles_list_and_string_sources`) and the negative
omission cases for `display_data` (html-only, image-only). A regression
that accidentally split the shared branch and dropped `display_data`'s
plain-text rendering would silently leak past the suite:
- `execute_result` would still render (existing test passes).
- `display_data` without text/plain would still be omitted (existing
negative tests pass).
- But `display_data` WITH text/plain — the realistic
`display(df)` / `display(fig)` case where a rich format co-emits
with a plain-text repr — would silently lose the repr.
Two new tests close the gap by exercising the exact co-emission pattern:
- `test_html_plus_text_plain_display_data_renders_text_plain` —
pandas-DataFrame-via-`display(df)` shape: text/html + text/plain
coexist; assert text/plain renders and text/html is still dropped.
- `test_image_plus_text_plain_display_data_renders_text_plain` —
matplotlib-display(fig) shape: image/png + text/plain coexist;
assert text/plain renders and image base64 is still dropped.
Both follow the existing inline-fixture pattern and use the canonical
real-world co-emission combinations.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent f9910c2 commit 9eee37a
1 file changed
Lines changed: 79 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
139 | 218 | | |
140 | 219 | | |
141 | 220 | | |
| |||
0 commit comments