Skip to content

Commit 60bd4b8

Browse files
fixup tests
1 parent 66afa9d commit 60bd4b8

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

pandas/tests/arrays/masked/test_indexing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
class TestSetitemValidation:
1010
def _check_setitem_invalid(self, arr, invalid):
11-
msg = f"Invalid value '{invalid!s}' for dtype {arr.dtype}"
11+
msg = f"Invalid value '{invalid!s}' for dtype '{arr.dtype}'"
1212
msg = re.escape(msg)
1313
with pytest.raises(TypeError, match=msg):
1414
arr[0] = invalid

pandas/tests/frame/indexing/test_indexing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1274,7 +1274,7 @@ def test_setting_mismatched_na_into_nullable_fails(
12741274
r"timedelta64\[ns\] cannot be converted to (Floating|Integer)Dtype",
12751275
r"datetime64\[ns\] cannot be converted to (Floating|Integer)Dtype",
12761276
"'values' contains non-numeric NA",
1277-
r"Invalid value '.*' for dtype (U?Int|Float)\d{1,2}",
1277+
r"Invalid value '.*' for dtype '(U?Int|Float)\d{1,2}'",
12781278
]
12791279
)
12801280
with pytest.raises(TypeError, match=msg):

pandas/tests/frame/indexing/test_where.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -931,7 +931,7 @@ def test_where_nullable_invalid_na(frame_or_series, any_numeric_ea_dtype):
931931

932932
mask = np.array([True, True, False], ndmin=obj.ndim).T
933933

934-
msg = r"Invalid value '.*' for dtype (U?Int|Float)\d{1,2}"
934+
msg = r"Invalid value '.*' for dtype '(U?Int|Float)\d{1,2}'"
935935

936936
for null in tm.NP_NAT_OBJECTS + [pd.NaT]:
937937
# NaT is an NA value that we should *not* cast to pd.NA dtype

pandas/tests/indexing/test_loc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1230,7 +1230,7 @@ def test_loc_setitem_str_to_small_float_conversion_type(self, using_infer_string
12301230
# assigning with loc/iloc attempts to set the values inplace, which
12311231
# in this case is successful
12321232
if using_infer_string:
1233-
with pytest.raises(TypeError, match="Must provide strings"):
1233+
with pytest.raises(TypeError, match="Invalid value"):
12341234
result.loc[result.index, "A"] = [float(x) for x in col_data]
12351235
else:
12361236
result.loc[result.index, "A"] = [float(x) for x in col_data]

0 commit comments

Comments
 (0)