]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.1869: tests: test failures with Python 3.14 and test_python3 v9.1.1869
authorYee Cheng Chin <ychin.git@gmail.com>
Fri, 24 Oct 2025 15:40:09 +0000 (15:40 +0000)
committerChristian Brabandt <cb@256bit.org>
Fri, 24 Oct 2025 15:40:09 +0000 (15:40 +0000)
Problem:  tests: test failures with Python 3.14 and test_python3
Solution: Adjust the expected error message (Yee Cheng Chin)

Python 3.14 changed the error message from "argument must be 2-item
sequence" to "argument must be 2-item tuple". Fix test to account for
that. Otherwise the error message for the `vim.current.window.cursor =
True` line would not match.

closes: #18629

Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/testdir/test_python3.vim
src/version.c

index bd000ef05adabb095aab2ffb1a8525ad7faedf1e..3cc5ff2d9fc715af1f927a3bedee45ac2c01c370 100644 (file)
@@ -28,6 +28,7 @@ func Test_AAA_python3_setup()
     py37_exception_repr = re.compile(r'([^\(\),])(\)+)$')
     py39_type_error_pattern = re.compile(r'\w+\.([^(]+\(\) takes)')
     py310_type_error_pattern = re.compile(r'takes (\d+) positional argument but (\d+) were given')
+    py314_type_error_tuple_pattern = re.compile(r'must be (\d+)-item tuple')
 
     def emsg(ei):
       return ei[0].__name__ + ':' + repr(ei[1].args)
@@ -64,6 +65,8 @@ func Test_AAA_python3_setup()
                         # Python 3.9 reports errors like "vim.command() takes ..." instead of "command() takes ..."
                         msg = py39_type_error_pattern.sub(r'\1', msg)
                         msg = py310_type_error_pattern.sub(r'takes exactly \1 positional argument (\2 given)', msg)
+                        # Python 3.14 has specific error messages for Tuple's
+                        msg = py314_type_error_tuple_pattern.sub(r'must be \1-item sequence', msg)
                 elif sys.version_info >= (3, 5) and e.__class__ is ValueError and str(e) == 'embedded null byte':
                     msg = repr((TypeError, TypeError('expected bytes with no null')))
                 else:
index 0d6a5fd124a3a5d18aadbe54b3bb6b006e1b1a7b..3001dbd1c039fc02156b0e6d93c32a40b8a68904 100644 (file)
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1869,
 /**/
     1868,
 /**/