From 90887723bb333b8233457a974800387ec2e8d328 Mon Sep 17 00:00:00 2001 From: Emmanuel Arias Date: Tue, 19 Nov 2024 13:55:17 -0300 Subject: [PATCH] iAdd new syntax in assert This commit add new syntax exception in assert only for Python3.13. --- pyflakes/test/test_api.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pyflakes/test/test_api.py b/pyflakes/test/test_api.py index ec1cbdbf..863f4dc3 100644 --- a/pyflakes/test/test_api.py +++ b/pyflakes/test/test_api.py @@ -774,8 +774,13 @@ def test_errors_syntax(self): with open(self.tempfilepath, 'wb') as fd: fd.write(b"import") d = self.runPyflakes([self.tempfilepath]) - error_msg = '{0}:1:7: invalid syntax{1}import{1} ^{1}'.format( - self.tempfilepath, os.linesep) + if sys.version_info >= (3, 13): + error_msg = ("{0}:1:7: Expected one or more names after 'import'" + "{1}import{1} ^{1}").format( + self.tempfilepath, os.linesep) + else: + error_msg = '{0}:1:7: invalid syntax{1}import{1} ^{1}'.format( + self.tempfilepath, os.linesep) self.assertEqual(d, ('', error_msg, 1)) def test_readFromStdin(self):