From b2d596ae019b7e284300a072ccbce8dd67fe2f41 Mon Sep 17 00:00:00 2001 From: Dan Basson Date: Fri, 26 Jun 2020 16:11:59 +0300 Subject: [PATCH] CLN: GH29547 format with f-strings --- pandas/tests/series/indexing/test_numeric.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pandas/tests/series/indexing/test_numeric.py b/pandas/tests/series/indexing/test_numeric.py index b5bef46e95ec2..7927c8a932971 100644 --- a/pandas/tests/series/indexing/test_numeric.py +++ b/pandas/tests/series/indexing/test_numeric.py @@ -83,19 +83,19 @@ def test_setitem_float_labels(): def test_slice_float_get_set(datetime_series): - msg = ( + msg = lambda key: ( "cannot do slice indexing on DatetimeIndex with these indexers " - r"\[{key}\] of type float" + f"{key} of type float" ) - with pytest.raises(TypeError, match=msg.format(key=r"4\.0")): + with pytest.raises(TypeError, match=msg(key=r"4\.0")): datetime_series[4.0:10.0] - with pytest.raises(TypeError, match=msg.format(key=r"4\.0")): + with pytest.raises(TypeError, match=msg(key=r"4\.0")): datetime_series[4.0:10.0] = 0 - with pytest.raises(TypeError, match=msg.format(key=r"4\.5")): + with pytest.raises(TypeError, match=msg(key=r"4\.5")): datetime_series[4.5:10.0] - with pytest.raises(TypeError, match=msg.format(key=r"4\.5")): + with pytest.raises(TypeError, match=msg(key=r"4\.5")): datetime_series[4.5:10.0] = 0