mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
gh-103492: Clarify SyntaxWarning with literal comparison (#103493)
This commit is contained in:
parent
79ae019164
commit
ae25855045
4 changed files with 34 additions and 16 deletions
|
@ -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")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue