|
1 | 1 | import sys
|
2 | 2 |
|
| 3 | +from IPython.core.display import HTML |
3 | 4 | import pytest
|
4 | 5 |
|
5 | 6 | from .utils import TIMEOUT, get_reply, new_kernel
|
@@ -220,12 +221,15 @@ def test_rich_inspect_not_at_breakpoint(kernel_with_debug):
|
220 | 221 |
|
221 | 222 |
|
222 | 223 | def test_rich_inspect_at_breakpoint(kernel_with_debug):
|
223 |
| - code = """def f(a, b, html): |
| 224 | + text_html = "<div><p>Hello World!</p></div>" |
| 225 | + text_plain = str(HTML(text_html)) |
| 226 | + |
| 227 | + code = f"""def f(a, b, html): |
224 | 228 | c = a + b
|
225 | 229 | return c
|
226 | 230 |
|
227 | 231 | from IPython.core.display import HTML
|
228 |
| -html = HTML("<div><p>Hello World!</p></div>") |
| 232 | +html = HTML("{text_html}") |
229 | 233 | f(2, 3, html)"""
|
230 | 234 |
|
231 | 235 | r = wait_for_debug_request(kernel_with_debug, "dumpCell", {"code": code})
|
@@ -284,7 +288,10 @@ def test_rich_inspect_at_breakpoint(kernel_with_debug):
|
284 | 288 | {"variableName": locals_[2]["name"], "frameId": stacks[0]["id"]},
|
285 | 289 | )
|
286 | 290 |
|
287 |
| - assert reply["body"]["data"] == {'text/html': '<div><p>Hello World!</p></div>', 'text/plain': '<IPython.core.displa...ML object>'} |
| 291 | + assert reply["body"]["data"] == { |
| 292 | + "text/html": text_html, |
| 293 | + "text/plain": text_plain, |
| 294 | + } |
288 | 295 |
|
289 | 296 |
|
290 | 297 | def test_convert_to_long_pathname():
|
|
0 commit comments