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>
This commit is contained in:
@@ -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'{{}}')
|
||||
|
||||
Reference in New Issue
Block a user