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

CLN: GH29547 replace old string formatting #32063

Merged
merged 5 commits into from
Feb 18, 2020
Merged
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/tslibs/test_parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ def test_parse_time_quarter_with_dash(dashed, normal):

@pytest.mark.parametrize("dashed", ["-2Q1992", "2-Q1992", "4-4Q1992"])
def test_parse_time_quarter_with_dash_error(dashed):
msg = "Unknown datetime string format, unable to parse: {dashed}"
msg = f"Unknown datetime string format, unable to parse: {dashed}"

with pytest.raises(parsing.DateParseError, match=msg.format(dashed=dashed)):
with pytest.raises(parsing.DateParseError, match=msg):
parse_time_string(dashed)


Expand Down Expand Up @@ -115,12 +115,12 @@ def test_parsers_quarter_invalid(date_str):
if date_str == "6Q-20":
msg = (
"Incorrect quarterly string is given, quarter "
"must be between 1 and 4: {date_str}"
f"must be between 1 and 4: {date_str}"
)
else:
msg = "Unknown datetime string format, unable to parse: {date_str}"
msg = f"Unknown datetime string format, unable to parse: {date_str}"

with pytest.raises(ValueError, match=msg.format(date_str=date_str)):
with pytest.raises(ValueError, match=msg):
parsing.parse_time_string(date_str)


Expand Down