Skip to content

Commit 4c31b3f

Browse files
authored
Remove missing future warning (#594)
1 parent 57b5cbd commit 4c31b3f

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

tests/test_unit/test_napari_plugin/test_data_loader_widget.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -650,8 +650,9 @@ def test_add_points_and_tracks_layer_style(
650650
# Check the color of the markers follows the expected property
651651
# (we check there are as many unique colors as there are unique
652652
# values in the expected property)
653+
points_layer_colormap_sorted = np.unique(points_layer.face_color, axis=0)
653654
assert (
654-
np.unique(points_layer.face_color, axis=0).shape[0]
655+
points_layer_colormap_sorted.shape[0]
655656
== np.unique(points_layer.properties[expected_color_property]).shape[0]
656657
)
657658

@@ -665,14 +666,15 @@ def test_add_points_and_tracks_layer_style(
665666
# name
666667
assert tracks_layer.colormap == points_layer.face_colormap.name
667668
# values
668-
list_colormap_keys = points_layer._face.categorical_colormap.colormap
669-
np.testing.assert_array_equal(
670-
[
671-
points_layer._face.categorical_colormap.colormap[ky]
672-
for ky in list_colormap_keys
673-
],
669+
text_colormap_sorted = np.r_[
674670
[
675-
points_layer.text.color.colormap.colormap[ky]
676-
for ky in list_colormap_keys
677-
],
671+
np.array(v)
672+
for v in points_layer.text.color.colormap.colormap.values()
673+
]
674+
]
675+
text_colormap_sorted = text_colormap_sorted[
676+
text_colormap_sorted[:, 0].argsort()
677+
]
678+
np.testing.assert_array_equal(
679+
points_layer_colormap_sorted, text_colormap_sorted
678680
)

0 commit comments

Comments
 (0)