diff --git a/pandas/tests/indexes/datetimes/test_date_range.py b/pandas/tests/indexes/datetimes/test_date_range.py index e09883e95ecec..1ec936f830768 100644 --- a/pandas/tests/indexes/datetimes/test_date_range.py +++ b/pandas/tests/indexes/datetimes/test_date_range.py @@ -802,8 +802,9 @@ def test_frequency_A_raises(self, freq): ) def test_date_range_depr_lowercase_frequency(self, freq, freq_depr): # GH#58998 - depr_msg = f"'{freq_depr[1:]}' is deprecated and will be removed " - "in a future version." + depr_msg = ( + f"'{freq_depr[1:]}' is deprecated and will be removed in a future version." + ) expected = date_range("1/1/2000", periods=4, freq=freq) with tm.assert_produces_warning(FutureWarning, match=depr_msg): diff --git a/pandas/tests/indexes/period/test_period_range.py b/pandas/tests/indexes/period/test_period_range.py index 51b03024ce272..85af43e7d2e5e 100644 --- a/pandas/tests/indexes/period/test_period_range.py +++ b/pandas/tests/indexes/period/test_period_range.py @@ -206,8 +206,10 @@ def test_constructor_U(self): @pytest.mark.parametrize("freq_depr", ["2MIN", "2US", "2NS"]) def test_uppercase_freq_deprecated_from_time_series(self, freq_depr): # GH#52536, GH#54939 - msg = f"'{freq_depr[1:]}' is deprecated and will be removed in a " - f"future version. Please use '{freq_depr.lower()[1:]}' instead." + msg = ( + f"'{freq_depr[1:]}' is deprecated and will be removed in a " + f"future version, please use '{freq_depr.lower()[1:]}' instead." + ) with tm.assert_produces_warning(FutureWarning, match=msg): 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): @pytest.mark.parametrize("freq", ["2w"]) def test_lowercase_freq_from_time_series_deprecated(self, freq): # GH#52536, GH#54939 - msg = f"'{freq[1:]}' is deprecated and will be removed in a " - f"future version. Please use '{freq.upper()[1:]}' instead." + msg = ( + f"'{freq[1:]}' is deprecated and will be removed in a " + f"future version, please use '{freq.upper()[1:]}' instead." + ) with tm.assert_produces_warning(FutureWarning, match=msg): period_range(freq=freq, start="1/1/2001", end="12/1/2009") diff --git a/pandas/tests/tslibs/test_to_offset.py b/pandas/tests/tslibs/test_to_offset.py index 67521c7e2a3ac..add9213ae59fb 100644 --- a/pandas/tests/tslibs/test_to_offset.py +++ b/pandas/tests/tslibs/test_to_offset.py @@ -207,8 +207,10 @@ def test_to_offset_lowercase_frequency_raises(freq_depr): @pytest.mark.parametrize("freq_depr", ["2MIN", "2Us", "2NS"]) def test_to_offset_uppercase_frequency_deprecated(freq_depr): # GH#54939 - depr_msg = f"'{freq_depr[1:]}' is deprecated and will be removed in a " - f"future version, please use '{freq_depr.lower()[1:]}' instead." + depr_msg = ( + f"'{freq_depr[1:]}' is deprecated and will be removed in a " + f"future version, please use '{freq_depr.lower()[1:]}' instead." + ) with tm.assert_produces_warning(FutureWarning, match=depr_msg): to_offset(freq_depr)