diff --git a/src/napari_matplotlib/tests/baseline/test_histogram_2D.png b/src/napari_matplotlib/tests/baseline/test_histogram_2D.png new file mode 100644 index 00000000..5b3dcd94 Binary files /dev/null and b/src/napari_matplotlib/tests/baseline/test_histogram_2D.png differ diff --git a/src/napari_matplotlib/tests/baseline/test_histogram_3D.png b/src/napari_matplotlib/tests/baseline/test_histogram_3D.png new file mode 100644 index 00000000..6a09711e Binary files /dev/null and b/src/napari_matplotlib/tests/baseline/test_histogram_3D.png differ diff --git a/src/napari_matplotlib/tests/baseline/test_slice_2D.png b/src/napari_matplotlib/tests/baseline/test_slice_2D.png new file mode 100644 index 00000000..9636b891 Binary files /dev/null and b/src/napari_matplotlib/tests/baseline/test_slice_2D.png differ diff --git a/src/napari_matplotlib/tests/baseline/test_slice_3D.png b/src/napari_matplotlib/tests/baseline/test_slice_3D.png new file mode 100644 index 00000000..4b974fa4 Binary files /dev/null and b/src/napari_matplotlib/tests/baseline/test_slice_3D.png differ diff --git a/src/napari_matplotlib/tests/test_histogram.py b/src/napari_matplotlib/tests/test_histogram.py index fa463642..e397029c 100644 --- a/src/napari_matplotlib/tests/test_histogram.py +++ b/src/napari_matplotlib/tests/test_histogram.py @@ -6,7 +6,7 @@ @pytest.mark.mpl_image_compare -def test_example_q_widget(make_napari_viewer, astronaut_data): +def test_histogram_2D(make_napari_viewer, astronaut_data): # Smoke test adding a histogram widget viewer = make_napari_viewer() viewer.add_image(astronaut_data[0], **astronaut_data[1]) @@ -14,3 +14,14 @@ def test_example_q_widget(make_napari_viewer, astronaut_data): # Need to return a copy, as original figure is too eagerley garbage # collected by the widget return deepcopy(fig) + + +@pytest.mark.mpl_image_compare +def test_histogram_3D(make_napari_viewer, brain_data): + # Smoke test adding a histogram widget + viewer = make_napari_viewer() + viewer.add_image(brain_data[0], **brain_data[1]) + fig = HistogramWidget(viewer).figure + # Need to return a copy, as original figure is too eagerley garbage + # collected by the widget + return deepcopy(fig) diff --git a/src/napari_matplotlib/tests/test_slice.py b/src/napari_matplotlib/tests/test_slice.py index 9905ad85..500d5ec0 100644 --- a/src/napari_matplotlib/tests/test_slice.py +++ b/src/napari_matplotlib/tests/test_slice.py @@ -6,10 +6,20 @@ @pytest.mark.mpl_image_compare -def test_slice(make_napari_viewer, brain_data): +def test_slice_3D(make_napari_viewer, brain_data): viewer = make_napari_viewer() viewer.add_image(brain_data[0], **brain_data[1]) fig = SliceWidget(viewer).figure # Need to return a copy, as original figure is too eagerley garbage # collected by the widget return deepcopy(fig) + + +@pytest.mark.mpl_image_compare +def test_slice_2D(make_napari_viewer, astronaut_data): + viewer = make_napari_viewer() + viewer.add_image(astronaut_data[0], **astronaut_data[1]) + fig = SliceWidget(viewer).figure + # Need to return a copy, as original figure is too eagerley garbage + # collected by the widget + return deepcopy(fig)