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):
7676 queries Nvim metadata for type information and sets a SessionHook for
7777 creating specialized objects from Nvim remote handles.
7878 """
79- session .error_wrapper = lambda e : NvimError (e [1 ])
79+ session .error_wrapper = lambda e : NvimError (decode_if_bytes ( e [1 ]) )
8080 channel_id , metadata = session .request (b'nvim_get_api_info' )
8181
8282 if IS_PYTHON3 :
Original file line number Diff line number Diff line change 33import sys
44import tempfile
55
6+ import pytest
7+
68
79def source (vim , code ):
810 fd , fname = tempfile .mkstemp ()
@@ -34,6 +36,12 @@ def test_command_output(vim):
3436 assert vim .command_output ('echo "test"' ) == 'test'
3537
3638
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+
3745def test_eval (vim ):
3846 vim .command ('let g:v1 = "a"' )
3947 vim .command ('let g:v2 = [1, 2, {"v3": 3}]' )
You can’t perform that action at this time.
0 commit comments