Skip to content

Commit 3f30f5f

Browse files
committed
tests: test_terminal.vim, fix expected return code for python3.13 on Windows
For some reasons, on Windows, python3.13 does no longer exit with the expected return code. So let's check for either exit code 1 or 123 in tests Test_terminal_duplicate_eof_arg() and Test_terminal_eof_arg() related: python/cpython#129900 Signed-off-by: Christian Brabandt <[email protected]>
1 parent bac7c4a commit 3f30f5f

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

Diff for: src/testdir/test_terminal.vim

+18-7
Original file line numberDiff line numberDiff line change
@@ -932,11 +932,6 @@ endfunc
932932

933933
func Test_terminal_eof_arg()
934934
call CheckPython(s:python)
935-
if has("win32")
936-
" This tests started to fail on Github Actions Windows
937-
" see: actions/runner-images#11512
938-
CheckGithubActions
939-
endif
940935
let g:test_is_flaky = 1
941936

942937
call setline(1, ['print("hello")'])
@@ -949,7 +944,15 @@ func Test_terminal_eof_arg()
949944
call WaitFor({-> getline('$') =~ 'hello'})
950945
call assert_equal('hello', getline('$'))
951946
endif
952-
call assert_equal(123, bufnr()->term_getjob()->job_info().exitval)
947+
let exitval = bufnr()->term_getjob()->job_info().exitval
948+
if !has('win32')
949+
call assert_equal(123, exitval)
950+
else
951+
" python 3.13 on Windows returns exit code 1
952+
" older versions returned correctly exit code 123
953+
" https://github.com/python/cpython/issues/129900
954+
call assert_match('1\|123', exitval)
955+
endif
953956
%bwipe!
954957
endfunc
955958

@@ -991,7 +994,15 @@ func Test_terminal_duplicate_eof_arg()
991994
call WaitFor({-> getline('$') =~ 'hello'})
992995
call assert_equal('hello', getline('$'))
993996
endif
994-
call assert_equal(123, bufnr()->term_getjob()->job_info().exitval)
997+
let exitval = bufnr()->term_getjob()->job_info().exitval
998+
if !has('win32')
999+
call assert_equal(123, exitval)
1000+
else
1001+
" python 3.13 on Windows returns exit code 1
1002+
" older versions returned correctly exit code 123
1003+
" https://github.com/python/cpython/issues/129900
1004+
call assert_match('1\|123', exitval)
1005+
endif
9951006
%bwipe!
9961007
endfunc
9971008

0 commit comments

Comments
 (0)