mirror of
https://github.com/tbabej/taskwiki.git
synced 2025-08-18 21:33:07 +02:00
tests: Catch vim errors in read_buffer
Without this, TestInfoActionNotTriggeredByEnterOnLink would pass because it asserts that the buffer is empty, which is what read_buffer returned if vim was stuck showing an error message. With `PYTEST_FLAGS=-s`, it would additionally log E449: Invalid expression received: Send expression failed. but that's easy to miss.
This commit is contained in:
parent
9457b509cf
commit
789d04f488
1 changed files with 7 additions and 1 deletions
|
@ -32,9 +32,15 @@ class IntegrationTest(object):
|
|||
assert result == u"0"
|
||||
|
||||
def read_buffer(self, start=0, end=1000):
|
||||
# ensure that vim isn't stuck stuck showing an error message
|
||||
# (read_buffer would ignore this and just return '')
|
||||
buf = self.client.get_active_buffer()
|
||||
assert buf
|
||||
|
||||
return self.client.read_buffer(
|
||||
six.text_type(start+1),
|
||||
six.text_type(end+1)
|
||||
six.text_type(end+1),
|
||||
buf=buf
|
||||
).splitlines()
|
||||
|
||||
def generate_data(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue