Skip to content

Commit

Permalink
Also test points deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
jni committed Aug 6, 2023
1 parent daef669 commit 3be54a7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion napari/layers/points/_tests/test_points.py
Expand Up @@ -2497,10 +2497,13 @@ def test_points_data_setter_emits_event():
assert len(emitted_events) == 1


def test_points_add_only_emits_one_event():
def test_points_add_delete_only_emit_one_event():
data = np.random.random((5, 2))
emitted_events = []
layer = Points(data)
layer.events.data.connect(lambda ev: emitted_events.append(ev))
layer.add(np.random.random(2))
assert len(emitted_events) == 1
layer.selected_data = {3}
layer.remove_selected()
assert len(emitted_events) == 2

0 comments on commit 3be54a7

Please sign in to comment.