Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions ipykernel/tests/test_debugger.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import sys

import pytest
from IPython.core.display import HTML

from .utils import TIMEOUT, get_reply, new_kernel

Expand Down Expand Up @@ -220,11 +221,16 @@ def test_rich_inspect_not_at_breakpoint(kernel_with_debug):


def test_rich_inspect_at_breakpoint(kernel_with_debug):
code = """def f(a, b):
text_html = "<div><p>Hello World!</p></div>"
text_plain = str(HTML(text_html))

code = f"""def f(a, b, html):
c = a + b
return c

f(2, 3)"""
from IPython.core.display import HTML
html = HTML("{text_html}")
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 +282,17 @@ 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": text_html,
"text/plain": text_plain,
}


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