File tree 1 file changed +5
-3
lines changed
packages/python/plotly/plotly/tests/test_core/test_px
1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -171,14 +171,16 @@ def test_zmin_zmax_range_color_source():
171
171
assert fig1 == fig2
172
172
173
173
174
- def test_imshow_xarray ():
174
+ @pytest .mark .parametrize ("binary_string" , [False , True ])
175
+ def test_imshow_xarray (binary_string ):
175
176
img = np .random .random ((20 , 30 ))
176
177
da = xr .DataArray (img , dims = ["dim_rows" , "dim_cols" ])
177
- fig = px .imshow (da )
178
+ fig = px .imshow (da , binary_string = binary_string )
178
179
# Dimensions are used for axis labels and coordinates
179
180
assert fig .layout .xaxis .title .text == "dim_cols"
180
181
assert fig .layout .yaxis .title .text == "dim_rows"
181
- assert np .all (np .array (fig .data [0 ].x ) == np .array (da .coords ["dim_cols" ]))
182
+ if not binary_string :
183
+ assert np .all (np .array (fig .data [0 ].x ) == np .array (da .coords ["dim_cols" ]))
182
184
183
185
184
186
def test_imshow_labels_and_ranges ():
You can’t perform that action at this time.
0 commit comments