gh-103492: Clarify SyntaxWarning with literal comparison (#103493)

This commit is contained in:
Shantanu 2023-04-24 15:42:57 -06:00 committed by GitHub
parent 79ae019164
commit ae25855045
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 34 additions and 16 deletions

View file

@ -277,7 +277,7 @@ class CodeopTests(unittest.TestCase):
def test_warning(self):
# Test that the warning is only returned once.
with warnings_helper.check_warnings(
('"is" with a literal', SyntaxWarning),
('"is" with \'str\' literal', SyntaxWarning),
("invalid escape sequence", SyntaxWarning),
) as w:
compile_command(r"'\e' is 0")