Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d174fed

Browse files
committed
Disable template in orca image tests
1 parent b0b970b commit d174fed

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

plotly/tests/test_orca/test_to_image.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ def format(request):
5858

5959
@pytest.fixture()
6060
def fig1():
61-
return go.Figure(data=[
61+
pio.templates.default = None
62+
yield go.Figure(data=[
6263
go.Bar(y=[2, 1, 4],
6364
marker=go.bar.Marker(color='purple',
6465
opacity=0.7)),
@@ -69,10 +70,12 @@ def fig1():
6970
'yaxis': {'showticklabels': False},
7071
'showlegend': False
7172
})
73+
pio.templates.default = 'plotly'
7274

7375

7476
@pytest.fixture()
7577
def topofig():
78+
pio.templates.default = None
7679
for col in topo_df.columns:
7780
topo_df[col] = topo_df[col].astype(str)
7881

@@ -115,11 +118,13 @@ def topofig():
115118
font={'family': 'Arial', 'size': 12},
116119
)
117120

118-
return dict(data=data, layout=layout)
121+
yield dict(data=data, layout=layout)
122+
pio.templates.default = 'plotly'
119123

120124

121125
@pytest.fixture()
122126
def latexfig():
127+
pio.templates.default = None
123128
trace1 = go.Scatter(
124129
x=[1, 2, 3, 4],
125130
y=[1, 4, 9, 16],
@@ -142,7 +147,8 @@ def latexfig():
142147
font={'family': 'Arial', 'size': 12}
143148
)
144149
fig = go.Figure(data=data, layout=layout)
145-
return fig
150+
yield fig
151+
pio.templates.default = 'plotly'
146152

147153

148154
# Utilities

0 commit comments

Comments
 (0)