Skip to content

Commit e594799

Browse files
committed
Added 3D test for test_histogram and 2D and 3D test images
1 parent 32f9b87 commit e594799

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/napari_matplotlib/tests/test_histogram.py

+12-1
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,22 @@
66

77

88
@pytest.mark.mpl_image_compare
9-
def test_example_q_widget(make_napari_viewer, astronaut_data):
9+
def test_histogram_2D(make_napari_viewer, astronaut_data):
1010
# Smoke test adding a histogram widget
1111
viewer = make_napari_viewer()
1212
viewer.add_image(astronaut_data[0], **astronaut_data[1])
1313
fig = HistogramWidget(viewer).figure
1414
# Need to return a copy, as original figure is too eagerley garbage
1515
# collected by the widget
1616
return deepcopy(fig)
17+
18+
19+
@pytest.mark.mpl_image_compare
20+
def test_histogram_3D(make_napari_viewer, brain_data):
21+
# Smoke test adding a histogram widget
22+
viewer = make_napari_viewer()
23+
viewer.add_image(brain_data[0], **brain_data[1])
24+
fig = HistogramWidget(viewer).figure
25+
# Need to return a copy, as original figure is too eagerley garbage
26+
# collected by the widget
27+
return deepcopy(fig)

0 commit comments

Comments
 (0)