Skip to content

Commit 1950eae

Browse files
authored
test: update asserts for Nvim 0.12 error messages #615
In 0.12.0, the error message is now: Invalid cursor line: out of range This updates the test to handle both old and new error messages.
1 parent 0e90453 commit 1950eae

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/test_vim.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""Tests interaction with neovim via Nvim API (with child process)."""
22

33
import os
4+
import re
45
import sys
56
import tempfile
67
from pathlib import Path
@@ -50,7 +51,7 @@ def test_command_output(vim: Nvim) -> None:
5051
def test_command_error(vim: Nvim) -> None:
5152
with pytest.raises(vim.error) as excinfo:
5253
vim.current.window.cursor = -1, -1
53-
assert excinfo.value.args == ('Cursor position outside buffer',)
54+
assert re.search(r"Cursor position outside buffer|Invalid cursor line", excinfo.value.args[0])
5455

5556

5657
def test_eval(vim: Nvim) -> None:

0 commit comments

Comments
 (0)