From 2fe1dfed848fc26b7419e3bfe91a62e686960429 Mon Sep 17 00:00:00 2001 From: Unit 193 Date: Sat, 9 Apr 2022 00:15:19 -0400 Subject: New upstream version 1.21.1. --- test/test_formatter.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test/test_formatter.py') diff --git a/test/test_formatter.py b/test/test_formatter.py index 8464b1b..4cce8a3 100644 --- a/test/test_formatter.py +++ b/test/test_formatter.py @@ -232,6 +232,14 @@ class TestFormatter(unittest.TestCase): self._run_test("\fE name * 2 + ' ' + a", "{}{} {}".format( self.kwdict["name"], self.kwdict["name"], self.kwdict["a"])) + @unittest.skipIf(sys.hexversion < 0x3060000, "no fstring support") + def test_fstring(self): + self._run_test("\fF {a}", self.kwdict["a"]) + self._run_test("\fF {name}{name} {a}", "{}{} {}".format( + self.kwdict["name"], self.kwdict["name"], self.kwdict["a"])) + self._run_test("\fF foo-'\"{a.upper()}\"'-bar", + """foo-'"{}"'-bar""".format(self.kwdict["a"].upper())) + def test_module(self): with tempfile.TemporaryDirectory() as tmpdirname: path = os.path.join(tmpdirname, "testmod.py") -- cgit v1.2.3