Skip to content

Commit a146ec2

Browse files
committed
Fix test_ensure_multivariate_data on 32-bit systems
In that case, the default int is also 32-bit, so the test will fail to be equal to `int64`. This is similar to matplotlib#30629.
1 parent d0927e8 commit a146ec2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/matplotlib/tests/test_colors.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2102,15 +2102,15 @@ def test_ensure_multivariate_data():
21022102
data = [[0, 0, 0], [1, 1, 1]]
21032103
mdata = mcolorizer._ensure_multivariate_data(data, 2)
21042104
assert mdata.shape == (3,)
2105-
assert mdata.dtype.fields['f0'][0] == np.int64
2106-
assert mdata.dtype.fields['f1'][0] == np.int64
2105+
assert np.issubdtype(mdata.dtype.fields['f0'][0], np.integer)
2106+
assert np.issubdtype(mdata.dtype.fields['f1'][0], np.integer)
21072107

21082108
# test input of floats, ints as tuple of lists
21092109
data = ([0.0, 0.0], [1, 1])
21102110
mdata = mcolorizer._ensure_multivariate_data(data, 2)
21112111
assert mdata.shape == (2,)
21122112
assert mdata.dtype.fields['f0'][0] == np.float64
2113-
assert mdata.dtype.fields['f1'][0] == np.int64
2113+
assert np.issubdtype(mdata.dtype.fields['f1'][0], np.integer)
21142114

21152115
# test input of array of floats
21162116
data = np.array([[0.0, 0, 0], [1, 1, 1]])

0 commit comments

Comments
 (0)