projects/guix·blob python-team · refs

29 lines · 1007 B

1Fix test_command_error for neovim 0.12.x.
2
3In 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
5the test to accept both messages.
6
7Taken from upstream commit d89b62ed622976c8d6dbc7733a99dac371b01cbf.
8
9diff --git a/test/test_vim.py b/test/test_vim.py
10index 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: