From 30a9ccf4caa72c62cb8656a1572518fef34b08a4 Mon Sep 17 00:00:00 2001 From: Damien George Date: Tue, 28 May 2024 10:52:12 +1000 Subject: 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 --- tests/basics/string_fstring.py | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'tests/basics/string_fstring.py') 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'{{}}') -- cgit v1.2.3