Skip to content

Commit d31ee8a

Browse files
committed
Fix mismatched scope async tests.
1 parent 2fae310 commit d31ee8a

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/py/tests/test_kaleido.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,21 @@
1010

1111

1212
@pytest.fixture(scope="session")
13-
async def simple_figure_with_bytes():
13+
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])
1818

19-
async with Kaleido() as k:
20-
bytes_data = await k.calc_fig(
21-
fig,
22-
opts={"format": "png", "width": 400, "height": 300},
23-
)
19+
async def build_obj():
20+
async with Kaleido() as k:
21+
bytes_data = await k.calc_fig(
22+
fig,
23+
opts={"format": "png", "width": 400, "height": 300},
24+
)
25+
return bytes_data
26+
27+
bytes_data = asyncio.run(build_obj())
2428

2529
# Assert it's a PNG by checking the PNG signature
2630
assert bytes_data[:8] == b"\x89PNG\r\n\x1a\n", "Generated data is not a valid PNG"

0 commit comments

Comments
 (0)