From d5a62139ef657544fc03c750bb9e1f55d98b9f54 Mon Sep 17 00:00:00 2001 From: Sam Cunliffe Date: Mon, 12 Jun 2023 13:23:02 +0100 Subject: [PATCH] Might as well go for 100% coverage. At least in the source code. --- src/napari_matplotlib/tests/scatter/test_scatter.py | 9 ++++++++- src/napari_matplotlib/tests/test_util.py | 3 +++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/napari_matplotlib/tests/scatter/test_scatter.py b/src/napari_matplotlib/tests/scatter/test_scatter.py index 930f4a47..a225863d 100644 --- a/src/napari_matplotlib/tests/scatter/test_scatter.py +++ b/src/napari_matplotlib/tests/scatter/test_scatter.py @@ -2,7 +2,7 @@ import pytest -from napari_matplotlib import ScatterWidget +from napari_matplotlib import ScatterBaseWidget, ScatterWidget @pytest.mark.mpl_image_compare @@ -48,3 +48,10 @@ def test_scatter_3D(make_napari_viewer, brain_data): viewer.layers.selection.add(viewer.layers[1]) return deepcopy(fig) + + +def test_get_data_notimplemented_on_base(make_napari_viewer): + viewer = make_napari_viewer() + widget = ScatterBaseWidget(viewer) + with pytest.raises(NotImplementedError): + widget._get_data() diff --git a/src/napari_matplotlib/tests/test_util.py b/src/napari_matplotlib/tests/test_util.py index ce025627..a8792d41 100644 --- a/src/napari_matplotlib/tests/test_util.py +++ b/src/napari_matplotlib/tests/test_util.py @@ -28,6 +28,9 @@ def test_interval(): with pytest.raises(ValueError, match="must be an integer"): "string" in interval # type: ignore + with pytest.raises(ValueError, match="must be <= upper_bound"): + Interval(5, 3) + @pytest.mark.parametrize( "lower, upper, text", pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy