Skip to content

Commit 016e057

Browse files
committed
update exc messages for npdev
1 parent 0110210 commit 016e057

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

pandas/tests/arithmetic/test_numeric.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,14 @@ def test_div_td64arr(self, left, box_cls):
169169
result = right // left
170170
tm.assert_equal(result, expected)
171171

172-
msg = "Cannot divide"
172+
msg = "|".join(
173+
[
174+
"Cannot divide",
175+
# 2021-12-09 new message in npdev
176+
"ufunc 'divide' cannot use operands with types "
177+
r"dtype\('.*'\) and dtype\('<m8\[ns\]'\)",
178+
]
179+
)
173180
with pytest.raises(TypeError, match=msg):
174181
left / right
175182

@@ -246,7 +253,14 @@ def test_numeric_arr_rdiv_tdscalar(self, three_days, numeric_idx, box_with_array
246253
result = three_days / index
247254
tm.assert_equal(result, expected)
248255

249-
msg = "cannot use operands with types dtype"
256+
msg = "|".join(
257+
[
258+
"cannot use operands with types dtype",
259+
# 2021-12-09 new message in npdev
260+
"ufunc 'divide' cannot use operands with types "
261+
r"dtype\('.*'\) and dtype\('<m8\[ns\]'\)",
262+
]
263+
)
250264
with pytest.raises(TypeError, match=msg):
251265
index / three_days
252266

pandas/tests/arithmetic/test_timedelta64.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1990,7 +1990,7 @@ def test_td64arr_div_numeric_scalar(self, box_with_array, two):
19901990
# 2021-12-09 npdev started giving a new message; not sure if it
19911991
# will be changed back
19921992
"ufunc 'divide' cannot use operands with types "
1993-
r"dtype\('float64'\) and dtype\('<m8\[ns\]'\)",
1993+
r"dtype\('.*'\) and dtype\('<m8\[ns\]'\)",
19941994
]
19951995
)
19961996
with pytest.raises(TypeError, match=msg):
@@ -2072,7 +2072,7 @@ def test_td64arr_div_numeric_array(
20722072
"Cannot divide",
20732073
# 2021-12-09 new message on npdev
20742074
"ufunc 'divide' cannot use operands with types "
2075-
r"dtype\('float32'\) and dtype\('<m8\[ns\]'\)",
2075+
r"dtype\('.*'\) and dtype\('<m8\[ns\]'\)",
20762076
]
20772077
)
20782078
with pytest.raises(TypeError, match=pattern):

0 commit comments

Comments
 (0)