diff options
author | Damien George <damien@micropython.org> | 2024-05-28 10:52:12 +1000 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2024-05-28 10:58:37 +1000 |
commit | 30a9ccf4caa72c62cb8656a1572518fef34b08a4 (patch) | |
tree | 125f373f880e1b3e1b632d1d5e2f5e90665e8cc3 /tests/basics/string_fstring.py | |
parent | dd4767a7d1ba57f107a652310fdfbd0f0274a0c8 (diff) | |
download | micropython-30a9ccf4caa72c62cb8656a1572518fef34b08a4.tar.gz micropython-30a9ccf4caa72c62cb8656a1572518fef34b08a4.zip |
tests/basics: Move str/bytes tests that give SyntaxWarning to sep file.
In CPython 3.12 these invalid str/bytes/fstring escapes will issue a
SyntaxWarning, and so differ to MicroPython.
Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'tests/basics/string_fstring.py')
-rw-r--r-- | tests/basics/string_fstring.py | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/tests/basics/string_fstring.py b/tests/basics/string_fstring.py index 1a3960680e..42d093b37b 100644 --- a/tests/basics/string_fstring.py +++ b/tests/basics/string_fstring.py @@ -29,21 +29,6 @@ print(f"a{[0,15,2][0:2][-1]:04x}") # Nested '{' and '}' characters. print(f"a{ {0,1,2}}") -# PEP-0498 specifies that '\\' and '#' must be disallowed explicitly, whereas -# MicroPython relies on the syntax error as a result of the substitution. - -print(f"\\") -print(f'#') -try: - eval("f'{\}'") -except SyntaxError: - print('SyntaxError') -try: - eval("f'{#}'") -except SyntaxError: - print('SyntaxError') - - # PEP-0498 specifies that handling of double braces '{{' or '}}' should # behave like str.format. print(f'{{}}') |