diff options
author | Lysandros Nikolaou <lisandrosnik@gmail.com> | 2025-04-30 11:46:41 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-30 11:46:41 +0200 |
commit | 60202609a2c2d0971aadfa4729ba30b50e89c6ea (patch) | |
tree | d821f3f8f277de56e5d8da457d492f1288cb2bb9 /Lib/test/test_unparse.py | |
parent | 5ea9010e8910cb97555c3aef4ed95cca93a74aab (diff) | |
download | cpython-60202609a2c2d0971aadfa4729ba30b50e89c6ea.tar.gz cpython-60202609a2c2d0971aadfa4729ba30b50e89c6ea.zip |
gh-132661: Implement PEP 750 (#132662)
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Wingy <git@wingysam.xyz>
Co-authored-by: Koudai Aono <koxudaxi@gmail.com>
Co-authored-by: Dave Peck <davepeck@gmail.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Paul Everitt <pauleveritt@me.com>
Co-authored-by: sobolevn <mail@sobolevn.me>
Diffstat (limited to 'Lib/test/test_unparse.py')
-rw-r--r-- | Lib/test/test_unparse.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Lib/test/test_unparse.py b/Lib/test/test_unparse.py index 839326f6436..d3af7a8489e 100644 --- a/Lib/test/test_unparse.py +++ b/Lib/test/test_unparse.py @@ -202,6 +202,15 @@ class UnparseTestCase(ASTTestCase): self.check_ast_roundtrip('f" something { my_dict["key"] } something else "') self.check_ast_roundtrip('f"{f"{f"{f"{f"{f"{1+1}"}"}"}"}"}"') + def test_tstrings(self): + self.check_ast_roundtrip("t'foo'") + self.check_ast_roundtrip("t'foo {bar}'") + self.check_ast_roundtrip("t'foo {bar!s:.2f}'") + self.check_ast_roundtrip("t'foo {bar}' f'{bar}'") + self.check_ast_roundtrip("f'{bar}' t'foo {bar}'") + self.check_ast_roundtrip("t'foo {bar}' fr'\\hello {bar}'") + self.check_ast_roundtrip("t'foo {bar}' u'bar'") + def test_strings(self): self.check_ast_roundtrip("u'foo'") self.check_ast_roundtrip("r'foo'") @@ -918,7 +927,7 @@ class DirectoryTestCase(ASTTestCase): run_always_files = {"test_grammar.py", "test_syntax.py", "test_compile.py", "test_ast.py", "test_asdl_parser.py", "test_fstring.py", "test_patma.py", "test_type_alias.py", "test_type_params.py", - "test_tokenize.py"} + "test_tokenize.py", "test_tstring.py"} _files_to_test = None |