Skip to content

Commit d2dd530

Browse files
committed
Fix test_kaleido tests.
1 parent 74c8765 commit d2dd530

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/py/tests/test_kaleido.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,11 @@
1010

1111

1212
@pytest.fixture
13-
async def simple_figure_with_bytes(tmp_path):
13+
async def simple_figure_with_bytes():
1414
"""Create a simple figure with calculated bytes and PNG assertion."""
1515
import plotly.express as px # noqa: PLC0415
1616

1717
fig = px.line(x=[1, 2, 3], y=[1, 2, 3])
18-
path = tmp_path / "test_figure.png"
1918

2019
async with Kaleido() as k:
2120
bytes_data = await k.calc_fig(
@@ -29,7 +28,6 @@ async def simple_figure_with_bytes(tmp_path):
2928
return {
3029
"fig": fig,
3130
"bytes": bytes_data,
32-
"path": path,
3331
"opts": {"format": "png", "width": 400, "height": 300},
3432
}
3533

@@ -331,7 +329,9 @@ async def test_tab_count_verification(n_tabs):
331329
# Send getTargets command directly to Kaleido (which is a Browser/Target)
332330
result = await k.send_command("Target.getTargets")
333331
# Count targets that are pages (not service workers, etc.)
334-
page_targets = [t for t in result["targetInfos"] if t.get("type") == "page"]
332+
page_targets = [
333+
t for t in result["result"]["targetInfos"] if t.get("type") == "page"
334+
]
335335
assert len(page_targets) >= n_tabs, (
336336
f"Found {len(page_targets)} page targets, expected at least {n_tabs}"
337337
)
@@ -377,7 +377,7 @@ async def test_plotlyjs_mathjax_injection(plotlyjs, mathjax):
377377
"expression": "document.documentElement.outerHTML",
378378
},
379379
)
380-
source = result["result"]["value"]
380+
source = result["result"]["result"]["value"]
381381

382382
if plotlyjs:
383383
# Check if plotlyjs URL is in the source

0 commit comments

Comments
 (0)