Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file.
25 changes: 25 additions & 0 deletions src/napari_matplotlib/tests/scatter/test_scatter.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
from copy import deepcopy

import pytest

from napari_matplotlib import ScatterWidget


@pytest.mark.mpl_image_compare
def test_scatter_2D(make_napari_viewer, astronaut_data):
viewer = make_napari_viewer()
widget = ScatterWidget(viewer)
fig = widget.figure

viewer.add_image(astronaut_data[0], **astronaut_data[1], name="astronaut")

viewer.add_image(
astronaut_data[0] * -1, **astronaut_data[1], name="astronaut_reversed"
)
# De-select existing selection
viewer.layers.selection.clear()

# Select images
viewer.layers.selection.add(viewer.layers[0])
viewer.layers.selection.add(viewer.layers[1])
return deepcopy(fig)
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,7 @@
import numpy.typing as npt
import pytest

from napari_matplotlib import FeaturesScatterWidget, ScatterWidget


@pytest.mark.mpl_image_compare
def test_scatter_2D(make_napari_viewer, astronaut_data):
viewer = make_napari_viewer()
widget = ScatterWidget(viewer)
fig = widget.figure

viewer.add_image(astronaut_data[0], **astronaut_data[1], name="astronaut")

viewer.add_image(
astronaut_data[0] * -1, **astronaut_data[1], name="astronaut_reversed"
)
# De-select existing selection
viewer.layers.selection.clear()

# Select images
viewer.layers.selection.add(viewer.layers[0])
viewer.layers.selection.add(viewer.layers[1])
return deepcopy(fig)
from napari_matplotlib import FeaturesScatterWidget


@pytest.mark.mpl_image_compare
Expand Down