Skip to content

Commit 12081bf

Browse files
committed
Expect the warning when importing the encoding test template
1 parent 2c14b2b commit 12081bf

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎Lib/test/test_string_literals.py‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,9 @@ def check_encoding(self, encoding, extra=""):
351351
f.write(extra)
352352
finally:
353353
f.close()
354-
__import__(modname)
354+
# TEMPLATE's k = '\ä' is an invalid escape in every encoding.
355+
with self.assertWarnsRegex(SyntaxWarning, r'"\\ä" is an invalid escape'):
356+
__import__(modname)
355357
del sys.modules[modname]
356358

357359
def test_file_utf_8(self):

0 commit comments

Comments
 (0)