Skip to content

Commit 965946d

Browse files
Raisa DzhamtyrovaRaisa Dzhamtyrova
authored andcommitted
changes to test_boolean.py and test_indexing.py
1 parent 18b5581 commit 965946d

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

pandas/tests/extension/test_boolean.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ def _check_op(self, s, op, other, op_name, exc=NotImplementedError):
115115
msg = r"numpy boolean subtract, the \`-\` operator.*"
116116
with pytest.raises(TypeError, match=msg):
117117
op(s, other)
118-
119118
return
120119

121120
result = op(s, other)
@@ -140,7 +139,7 @@ def _check_op(self, s, op, other, op_name, exc=NotImplementedError):
140139
expected[result.isna()] = np.nan
141140
self.assert_series_equal(result, expected)
142141
else:
143-
with pytest.raises(exc, match=msg):
142+
with pytest.raises(exc):
144143
op(s, other)
145144

146145
def _check_divmod_op(self, s, op, other, exc=None):

pandas/tests/frame/indexing/test_indexing.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ def test_setitem(self, float_frame):
481481
# so raise/warn
482482
smaller = float_frame[:2]
483483

484-
msg = r"\nA value is trying to be set on a copy of a slice from a DataFrame.*"
484+
msg = r"\nA value is trying to be set on a copy of a slice from a DataFrame"
485485
with pytest.raises(com.SettingWithCopyError, match=msg):
486486
smaller["col10"] = ["1", "2"]
487487

@@ -866,7 +866,7 @@ def test_fancy_getitem_slice_mixed(self, float_frame, float_string_frame):
866866
# setting it triggers setting with copy
867867
sliced = float_frame.iloc[:, -3:]
868868

869-
msg = r"\nA value is trying to be set on a copy of a slice from a DataFrame.*"
869+
msg = r"\nA value is trying to be set on a copy of a slice from a DataFrame"
870870
with pytest.raises(com.SettingWithCopyError, match=msg):
871871
sliced["C"] = 4.0
872872

@@ -1472,7 +1472,7 @@ def test_iloc_row(self):
14721472

14731473
# verify slice is view
14741474
# setting it makes it raise/warn
1475-
msg = r"\nA value is trying to be set on a copy of a slice from a DataFrame.*"
1475+
msg = r"\nA value is trying to be set on a copy of a slice from a DataFrame"
14761476
with pytest.raises(com.SettingWithCopyError, match=msg):
14771477
result[2] = 0.0
14781478

@@ -1504,7 +1504,7 @@ def test_iloc_col(self):
15041504

15051505
# verify slice is view
15061506
# and that we are setting a copy
1507-
msg = r"\nA value is trying to be set on a copy of a slice from a DataFrame.*"
1507+
msg = r"\nA value is trying to be set on a copy of a slice from a DataFrame"
15081508
with pytest.raises(com.SettingWithCopyError, match=msg):
15091509
result[8] = 0.0
15101510

0 commit comments

Comments
 (0)