Skip to content

Commit ed4ba16

Browse files
committed
ordereddict for py2
1 parent 659e2b9 commit ed4ba16

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/python/plotly/plotly/tests/test_core/test_px/test_px_hover.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import pandas as pd
44
import pytest
55
import plotly.graph_objects as go
6+
from collections import OrderedDict # an OrderedDict is needed for Python 2
67

78

89
def test_skip_hover():
@@ -19,13 +20,16 @@ def test_skip_hover():
1920

2021
def test_composite_hover():
2122
df = px.data.tips()
23+
hover_dict = OrderedDict(
24+
{"day": False, "sex": True, "time": False, "total_bill": ".1f"}
25+
)
2226
fig = px.scatter(
2327
df,
2428
x="tip",
2529
y="total_bill",
2630
color="day",
2731
facet_row="time",
28-
hover_data={"day": False, "sex": True, "time": False, "total_bill": ".1f"},
32+
hover_data=hover_dict,
2933
)
3034
assert (
3135
fig.data[0].hovertemplate

0 commit comments

Comments
 (0)