Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TST: Improve compatibility with pypy error messages #28844

Merged
merged 1 commit into from
Oct 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions pandas/tests/arithmetic/test_datetime64.py
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,7 @@ def test_dt64arr_add_sub_td64ndarray(self, tz_naive_fixture, box_with_array):

result = dtarr - tdarr
tm.assert_equal(result, expected)
msg = "cannot subtract|bad operand type for unary -"
msg = "cannot subtract|(bad|unsupported) operand type for unary"
with pytest.raises(TypeError, match=msg):
tdarr - dtarr

Expand Down Expand Up @@ -1126,7 +1126,7 @@ def test_dt64arr_series_sub_tick_DateOffset(self, box_with_array):

result2 = -pd.offsets.Second(5) + ser
tm.assert_equal(result2, expected)
msg = "bad operand type for unary"
msg = "(bad|unsupported) operand type for unary"
with pytest.raises(TypeError, match=msg):
pd.offsets.Second(5) - ser

Expand Down Expand Up @@ -1220,7 +1220,7 @@ def test_dt64arr_add_sub_relativedelta_offsets(self, box_with_array):
expected = DatetimeIndex([x - off for x in vec_items])
expected = tm.box_expected(expected, box_with_array)
tm.assert_equal(expected, vec - off)
msg = "bad operand type for unary"
msg = "(bad|unsupported) operand type for unary"
with pytest.raises(TypeError, match=msg):
off - vec

Expand Down Expand Up @@ -1336,7 +1336,7 @@ def test_dt64arr_add_sub_DateOffsets(
expected = DatetimeIndex([offset + x for x in vec_items])
expected = tm.box_expected(expected, box_with_array)
tm.assert_equal(expected, offset + vec)
msg = "bad operand type for unary"
msg = "(bad|unsupported) operand type for unary"
with pytest.raises(TypeError, match=msg):
offset - vec

Expand Down Expand Up @@ -1920,7 +1920,7 @@ def test_operators_datetimelike_with_timezones(self):
result = dt1 - td1[0]
exp = (dt1.dt.tz_localize(None) - td1[0]).dt.tz_localize(tz)
tm.assert_series_equal(result, exp)
msg = "bad operand type for unary"
msg = "(bad|unsupported) operand type for unary"
with pytest.raises(TypeError, match=msg):
td1[0] - dt1

Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/arithmetic/test_timedelta64.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ def test_subtraction_ops(self):
with pytest.raises(TypeError, match=msg):
td - dt

msg = "bad operand type for unary -: 'DatetimeArray'"
msg = "(bad|unsupported) operand type for unary"
with pytest.raises(TypeError, match=msg):
td - dti

Expand Down