Skip to content

Commit 3fb2f94

Browse files
committed
improve test_get_exceptions
1 parent 97b343b commit 3fb2f94

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

test/test_buffer.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,12 @@ def test_invalid_utf8(vim):
154154

155155

156156
def test_get_exceptions(vim):
157-
try:
157+
with pytest.raises(vim.error) as excinfo:
158158
vim.current.buffer.options['invalid-option']
159-
assert False
160-
except vim.error:
161-
pass
159+
160+
assert isinstance(excinfo.value, KeyError)
161+
assert excinfo.value.args == ("Invalid option name: 'invalid-option'",)
162+
162163

163164

164165
def test_set_items_for_range(vim):

0 commit comments

Comments
 (0)