Skip to content

Commit

Permalink
Add richInspectVariables test with HTML repr
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbrochart committed May 30, 2022
1 parent 3f9ed67 commit 1ffd278
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions ipykernel/tests/test_debugger.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,11 +220,13 @@ def test_rich_inspect_not_at_breakpoint(kernel_with_debug):


def test_rich_inspect_at_breakpoint(kernel_with_debug):
code = """def f(a, b):
code = """def f(a, b, html):
c = a + b
return c
f(2, 3)"""
from IPython.core.display import HTML
html = HTML("<div><p>Hello World!</p></div>")
f(2, 3, html)"""

r = wait_for_debug_request(kernel_with_debug, "dumpCell", {"code": code})
source = r["body"]["sourcePath"]
Expand Down Expand Up @@ -276,6 +278,14 @@ def test_rich_inspect_at_breakpoint(kernel_with_debug):

assert reply["body"]["data"] == {"text/plain": locals_[0]["value"]}

reply = wait_for_debug_request(
kernel_with_debug,
"richInspectVariables",
{"variableName": locals_[2]["name"], "frameId": stacks[0]["id"]},
)

assert reply["body"]["data"] == {'text/html': '<div><p>Hello World!</p></div>', 'text/plain': '<IPython.core.displa...ML object>'}


def test_convert_to_long_pathname():
if sys.platform == "win32":
Expand Down

0 comments on commit 1ffd278

Please sign in to comment.