diff options
| author | Ryan Campbell <campbellr@gmail.com> | 2026-04-13 16:37:56 -0600 |
|---|---|---|
| committer | Cayetano Santos <csantosb@inventati.org> | 2026-04-15 11:42:50 +0200 |
| commit | 99fdbdef6a3311d202f3a35b710363986ec5c794 (patch) | |
| tree | 2d846bbf5653e27af9739aa8353c1be27eb8d2f7 /gnu/packages | |
| parent | 101b12a54a84ae590559849e00ae9fe9d010c021 (diff) | |
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 <csantosb@inventati.org>
Diffstat (limited to 'gnu/packages')
| -rw-r--r-- | gnu/packages/patches/python-pynvim-fix-test-command-error.patch | 29 | ||||
| -rw-r--r-- | gnu/packages/vim.scm | 5 |
2 files changed, 33 insertions, 1 deletions
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 00000000000..40dd58b2500 --- /dev/null +++ b/gnu/packages/patches/python-pynvim-fix-test-command-error.patch | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | Fix test_command_error for neovim 0.12.x. | ||
| 2 | |||
| 3 | In neovim 0.12.0, the error message for an invalid cursor position changed from | ||
| 4 | "Cursor position outside buffer" to "Invalid cursor line: out of range". Update | ||
| 5 | the test to accept both messages. | ||
| 6 | |||
| 7 | Taken from upstream commit d89b62ed622976c8d6dbc7733a99dac371b01cbf. | ||
| 8 | |||
| 9 | diff --git a/test/test_vim.py b/test/test_vim.py | ||
| 10 | index 8a76f5e..26e2fce 100644 | ||
| 11 | --- a/test/test_vim.py | ||
| 12 | +++ b/test/test_vim.py | ||
| 13 | @@ -1,6 +1,7 @@ | ||
| 14 | """Tests interaction with neovim via Nvim API (with child process).""" | ||
| 15 | |||
| 16 | import os | ||
| 17 | +import re | ||
| 18 | import sys | ||
| 19 | import tempfile | ||
| 20 | from pathlib import Path | ||
| 21 | @@ -50,7 +51,7 @@ def test_command_output(vim: Nvim) -> None: | ||
| 22 | def test_command_error(vim: Nvim) -> None: | ||
| 23 | with pytest.raises(vim.error) as excinfo: | ||
| 24 | vim.current.window.cursor = -1, -1 | ||
| 25 | - assert excinfo.value.args == ('Cursor position outside buffer',) | ||
| 26 | + assert re.search(r"Cursor position outside buffer|Invalid cursor line", excinfo.value.args[0]) | ||
| 27 | |||
| 28 | |||
| 29 | def test_eval(vim: Nvim) -> None: | ||
diff --git a/gnu/packages/vim.scm b/gnu/packages/vim.scm index aebc5e3dd48..345706c2528 100644 --- a/gnu/packages/vim.scm +++ b/gnu/packages/vim.scm | |||
| @@ -1017,7 +1017,10 @@ With the package comes a plugin to use vifm as a vim file selector.") | |||
| 1017 | (commit version))) | 1017 | (commit version))) |
| 1018 | (file-name (git-file-name name version)) | 1018 | (file-name (git-file-name name version)) |
| 1019 | (sha256 | 1019 | (sha256 |
| 1020 | (base32 "0k98c0i14z3adx6l4ncf2zmzk9aykqkdnws6qw4m0yj5z61zh6av")))) | 1020 | (base32 "0k98c0i14z3adx6l4ncf2zmzk9aykqkdnws6qw4m0yj5z61zh6av")) |
| 1021 | ;; This patch can be removed when the next pynvim version after 0.6.0 is | ||
| 1022 | ;; released. | ||
| 1023 | (patches (search-patches "python-pynvim-fix-test-command-error.patch")))) | ||
| 1021 | (build-system pyproject-build-system) | 1024 | (build-system pyproject-build-system) |
| 1022 | (native-inputs | 1025 | (native-inputs |
| 1023 | (list neovim | 1026 | (list neovim |
