Skip to content

Commit af16382

Browse files
authored
Fix false friends in implicit string concatenation in tests (#61228)
Fix false friends in implicit string concatenation
1 parent 04356be commit af16382

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

pandas/tests/indexes/datetimes/test_date_range.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -802,8 +802,9 @@ def test_frequency_A_raises(self, freq):
802802
)
803803
def test_date_range_depr_lowercase_frequency(self, freq, freq_depr):
804804
# GH#58998
805-
depr_msg = f"'{freq_depr[1:]}' is deprecated and will be removed "
806-
"in a future version."
805+
depr_msg = (
806+
f"'{freq_depr[1:]}' is deprecated and will be removed in a future version."
807+
)
807808

808809
expected = date_range("1/1/2000", periods=4, freq=freq)
809810
with tm.assert_produces_warning(FutureWarning, match=depr_msg):

pandas/tests/indexes/period/test_period_range.py

+8-4
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,10 @@ def test_constructor_U(self):
206206
@pytest.mark.parametrize("freq_depr", ["2MIN", "2US", "2NS"])
207207
def test_uppercase_freq_deprecated_from_time_series(self, freq_depr):
208208
# GH#52536, GH#54939
209-
msg = f"'{freq_depr[1:]}' is deprecated and will be removed in a "
210-
f"future version. Please use '{freq_depr.lower()[1:]}' instead."
209+
msg = (
210+
f"'{freq_depr[1:]}' is deprecated and will be removed in a "
211+
f"future version, please use '{freq_depr.lower()[1:]}' instead."
212+
)
211213

212214
with tm.assert_produces_warning(FutureWarning, match=msg):
213215
period_range("2020-01-01 00:00:00 00:00", periods=2, freq=freq_depr)
@@ -230,8 +232,10 @@ def test_A_raises_from_time_series(self, freq):
230232
@pytest.mark.parametrize("freq", ["2w"])
231233
def test_lowercase_freq_from_time_series_deprecated(self, freq):
232234
# GH#52536, GH#54939
233-
msg = f"'{freq[1:]}' is deprecated and will be removed in a "
234-
f"future version. Please use '{freq.upper()[1:]}' instead."
235+
msg = (
236+
f"'{freq[1:]}' is deprecated and will be removed in a "
237+
f"future version, please use '{freq.upper()[1:]}' instead."
238+
)
235239

236240
with tm.assert_produces_warning(FutureWarning, match=msg):
237241
period_range(freq=freq, start="1/1/2001", end="12/1/2009")

pandas/tests/tslibs/test_to_offset.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,10 @@ def test_to_offset_lowercase_frequency_raises(freq_depr):
207207
@pytest.mark.parametrize("freq_depr", ["2MIN", "2Us", "2NS"])
208208
def test_to_offset_uppercase_frequency_deprecated(freq_depr):
209209
# GH#54939
210-
depr_msg = f"'{freq_depr[1:]}' is deprecated and will be removed in a "
211-
f"future version, please use '{freq_depr.lower()[1:]}' instead."
210+
depr_msg = (
211+
f"'{freq_depr[1:]}' is deprecated and will be removed in a "
212+
f"future version, please use '{freq_depr.lower()[1:]}' instead."
213+
)
212214

213215
with tm.assert_produces_warning(FutureWarning, match=depr_msg):
214216
to_offset(freq_depr)

0 commit comments

Comments
 (0)