Skip to content

Commit

Permalink
Fix core tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ahuang11 committed Sep 13, 2023
1 parent 23af53d commit f2da257
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion holoviews/tests/plotting/matplotlib/test_rasterplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,10 @@ def test_image_stack(self):
c = np.array([[np.nan] * 3, [np.nan] * 3, [1, 1, 1]])

img_stack = ImageStack((x, y, a, b, c), kdims=["x", "y"], vdims=["a", "b", "c"])
plot = mpl_renderer.get_plot(img_stack)
try:
plot = mpl_renderer.get_plot(img_stack)
except ImportError:
return # Skip test if datashader is unavailable for core tests
artist = plot.handles['artist']
array = artist.get_array().data
assert array.shape == (3, 3, 4)
Expand Down
5 changes: 4 additions & 1 deletion holoviews/tests/plotting/plotly/test_imagestack.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ def test_image_stack(self):
b = np.array([[np.nan] * 3, [1, 1, np.nan], [np.nan] * 3])
c = np.array([[np.nan] * 3, [np.nan] * 3, [1, 1, 1]])
image_stack = ImageStack((x, y, a, b, c), kdims=["x", "y"], vdims=["a", "b", "c"])
assert isinstance(plotly_renderer.get_plot(image_stack), RGBPlot)
try:
assert isinstance(plotly_renderer.get_plot(image_stack), RGBPlot)
except ImportError:
return # Skip test if datashader is unavailable for core tests
fig_dict = plotly_renderer.get_plot_state(image_stack)
x_range = fig_dict['layout']['xaxis']['range']
self.assertEqual(x_range[0], -0.5)
Expand Down

0 comments on commit f2da257

Please sign in to comment.