Skip to content

Commit

Permalink
Fix test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
maushumee committed Aug 24, 2024
1 parent 52186cc commit 53cd943
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pandas/tests/frame/test_block_internals.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ def f(dtype):
f("float64")

# 10822
msg = "^Unknown datetime string format, unable to parse: aa, at position 0$"
msg = "^Unknown datetime string format, unable to parse: aa$"
with pytest.raises(ValueError, match=msg):
f("M8[ns]")

Expand Down
4 changes: 2 additions & 2 deletions pandas/tests/io/parser/test_parse_dates.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,8 +507,8 @@ def test_parse_multiple_delimited_dates_with_swap_warnings():
with pytest.raises(
ValueError,
match=(
r'^time data "31/05/2000" doesn\'t match format "%m/%d/%Y", '
r"at position 1. You might want to try:"
r'^time data "31/05/2000" doesn\'t match format "%m/%d/%Y". '
r"You might want to try:"
),
):
pd.to_datetime(["01/01/2000", "31/05/2000", "31/05/2001", "01/02/2000"])
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/series/test_constructors.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def test_infer_with_date_and_datetime(self):
def test_unparsable_strings_with_dt64_dtype(self):
# pre-2.0 these would be silently ignored and come back with object dtype
vals = ["aa"]
msg = "^Unknown datetime string format, unable to parse: aa, at position 0$"
msg = "^Unknown datetime string format, unable to parse: aa$"
with pytest.raises(ValueError, match=msg):
Series(vals, dtype="datetime64[ns]")

Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/tslibs/test_array_to_datetime.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ def test_to_datetime_barely_out_of_bounds():
# Close enough to bounds that dropping nanos
# would result in an in-bounds datetime.
arr = np.array(["2262-04-11 23:47:16.854775808"], dtype=object)
msg = "^Out of bounds nanosecond timestamp: 2262-04-11 23:47:16, at position 0$"
msg = "^Out of bounds nanosecond timestamp: 2262-04-11 23:47:16$"

with pytest.raises(tslib.OutOfBoundsDatetime, match=msg):
tslib.array_to_datetime(arr)
Expand Down

0 comments on commit 53cd943

Please sign in to comment.