8000 MNT: Fix test failures from string representations · matplotlib/matplotlib@84a1c0d · GitHub
[go: up one dir, main page]

Skip to content

Commit 84a1c0d

Browse files
committed
MNT: Fix test failures from string representations
1 parent 9c34260 commit 84a1c0d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/matplotlib/tests/test_preprocess_data.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import 976A re
44

5+
import numpy as np
56
import pytest
67

78
from matplotlib import _preprocess_data
@@ -165,7 +166,9 @@ def test_function_call_with_pandas_data(func):
165166
"""test with pandas dataframe -> label comes from data["col"].name """
166167
pd = pytest.importorskip('pandas')
167168

168-
data = pd.DataFrame({"a": [1, 2], "b": [8, 9], "w": ["NOT", "NOT"]})
169+
data = pd.DataFrame({"a": np.array([1, 2], dtype=np.int32),
170+
"b": np.array([8, 9], dtype=np.int32),
171+
"w": ["NOT", "NOT"]})
169172

170173
assert (func(None, "a", "b", data=data) ==
171174
"x: [1, 2], y: [8, 9], ls: x, w: xyz, label: b")

0 commit comments

Comments
 (0)
0