diff options
| author | 2022-04-09 00:15:19 -0400 | |
|---|---|---|
| committer | 2022-04-09 00:15:19 -0400 | |
| commit | 2fe1dfed848fc26b7419e3bfe91a62e686960429 (patch) | |
| tree | 901cb64e2a1748df2bb8c7abc60ff6d72ae4bc27 /test/test_formatter.py | |
| parent | c2e774d3f5a4499b8beb5a12ab46a0099b16b1e7 (diff) | |
New upstream version 1.21.1.upstream/1.21.1
Diffstat (limited to 'test/test_formatter.py')
| -rw-r--r-- | test/test_formatter.py | 8 |
1 files changed, 8 insertions, 0 deletions
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") |
