File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ def from_session(cls, session):
76
76
queries Nvim metadata for type information and sets a SessionHook for
77
77
creating specialized objects from Nvim remote handles.
78
78
"""
79
- session .error_wrapper = lambda e : NvimError (e [1 ])
79
+ session .error_wrapper = lambda e : NvimError (decode_if_bytes ( e [1 ]) )
80
80
channel_id , metadata = session .request (b'nvim_get_api_info' )
81
81
82
82
if IS_PYTHON3 :
Original file line number Diff line number Diff line change 3
3
import sys
4
4
import tempfile
5
5
6
+ import pytest
7
+
6
8
7
9
def source (vim , code ):
8
10
fd , fname = tempfile .mkstemp ()
@@ -34,6 +36,12 @@ def test_command_output(vim):
34
36
assert vim .command_output ('echo "test"' ) == 'test'
35
37
36
38
39
+ def test_command_error (vim ):
40
+ with pytest .raises (vim .error ) as excinfo :
41
+ vim .current .window .cursor = - 1 , - 1
42
+ assert excinfo .value .args == ('Cursor position outside buffer' ,)
43
+
44
+
37
45
def test_eval (vim ):
38
46
vim .command ('let g:v1 = "a"' )
39
47
vim .command ('let g:v2 = [1, 2, {"v3": 3}]' )
You can’t perform that action at this time.
0 commit comments