From 7d284b72ab7867f9f9293628c2ff013b2d5a1dc7 Mon Sep 17 00:00:00 2001 From: nulano Date: Tue, 22 Sep 2020 22:19:04 +0100 Subject: [PATCH] f-strings! Co-authored-by: Hugo van Kemenade --- Tests/test_imagefont.py | 4 ++-- Tests/test_imagefontctl.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Tests/test_imagefont.py b/Tests/test_imagefont.py index 0080cbfb1..e47cb05c1 100644 --- a/Tests/test_imagefont.py +++ b/Tests/test_imagefont.py @@ -770,7 +770,7 @@ class TestImageFont: ) def test_anchor(self, anchor): name, text = "quick", "Quick" - path = "Tests/images/test_anchor_%s_%s.png" % (name, anchor) + path = f"Tests/images/test_anchor_{name}_{anchor}.png" f = ImageFont.truetype( "Tests/fonts/NotoSans-Regular.ttf", 48, layout_engine=self.LAYOUT_ENGINE ) @@ -804,7 +804,7 @@ class TestImageFont: ), ) def test_anchor_multiline(self, anchor, align): - target = "Tests/images/test_anchor_multiline_%s_%s.png" % (anchor, align) + target = f"Tests/images/test_anchor_multiline_{anchor}_{align}.png" text = "a\nlong\ntext sample" f = ImageFont.truetype( diff --git a/Tests/test_imagefontctl.py b/Tests/test_imagefontctl.py index 7fceecfb9..0012d6bd0 100644 --- a/Tests/test_imagefontctl.py +++ b/Tests/test_imagefontctl.py @@ -217,7 +217,7 @@ def test_anchor_ttb(anchor): pytest.skip("FreeType <2.5.1 has incompatible ttb metrics") text = "f" - path = "Tests/images/test_anchor_ttb_%s_%s.png" % (text, anchor) + path = f"Tests/images/test_anchor_ttb_{text}_{anchor}.png" f = ImageFont.truetype("Tests/fonts/NotoSans-Regular.ttf", 120) im = Image.new("RGB", (200, 400), "white") @@ -281,7 +281,7 @@ def test_combine(name, text, dir, anchor, epsilon): # Improved computation of emulated vertical metrics for TrueType fonts. pytest.skip("FreeType <2.5.1 has incompatible ttb metrics") - path = "Tests/images/test_combine_%s.png" % name + path = f"Tests/images/test_combine_{name}.png" f = ImageFont.truetype("Tests/fonts/NotoSans-Regular.ttf", 48) im = Image.new("RGB", (400, 400), "white")