From 99fdbdef6a3311d202f3a35b710363986ec5c794 Mon Sep 17 00:00:00 2001 From: Ryan Campbell Date: Mon, 13 Apr 2026 16:37:56 -0600 Subject: gnu: python-pynvim: Fix test_command_error with neovim 0.12.x. Neovim 0.12.0 changed the error message for invalid cursor positions from "Cursor position outside buffer" to "Invalid cursor line: out of range", causing test_command_error to fail. This applies the upstream patch temporarily until a new pynvim release is created. Merges guix/guix!7755 * gnu/packages/patches/python-pynvim-fix-test-command-error.patch: New patch. * gnu/local.mk (dist_patch_DATA): Register it. * gnu/packages/vim.scm (python-pynvim)[source]: Use it. Change-Id: Ibff0545a60948c946c420fe7118a37d161d93a30 Signed-off-by: Cayetano Santos --- .../python-pynvim-fix-test-command-error.patch | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 gnu/packages/patches/python-pynvim-fix-test-command-error.patch (limited to 'gnu/packages/patches/python-pynvim-fix-test-command-error.patch') diff --git a/gnu/packages/patches/python-pynvim-fix-test-command-error.patch b/gnu/packages/patches/python-pynvim-fix-test-command-error.patch new file mode 100644 index 0000000000..40dd58b250 --- /dev/null +++ b/gnu/packages/patches/python-pynvim-fix-test-command-error.patch @@ -0,0 +1,29 @@ +Fix test_command_error for neovim 0.12.x. + +In neovim 0.12.0, the error message for an invalid cursor position changed from +"Cursor position outside buffer" to "Invalid cursor line: out of range". Update +the test to accept both messages. + +Taken from upstream commit d89b62ed622976c8d6dbc7733a99dac371b01cbf. + +diff --git a/test/test_vim.py b/test/test_vim.py +index 8a76f5e..26e2fce 100644 +--- a/test/test_vim.py ++++ b/test/test_vim.py +@@ -1,6 +1,7 @@ + """Tests interaction with neovim via Nvim API (with child process).""" + + import os ++import re + import sys + import tempfile + from pathlib import Path +@@ -50,7 +51,7 @@ def test_command_output(vim: Nvim) -> None: + def test_command_error(vim: Nvim) -> None: + with pytest.raises(vim.error) as excinfo: + vim.current.window.cursor = -1, -1 +- assert excinfo.value.args == ('Cursor position outside buffer',) ++ assert re.search(r"Cursor position outside buffer|Invalid cursor line", excinfo.value.args[0]) + + + def test_eval(vim: Nvim) -> None: -- cgit v1.3