Closed bstaletic closed 9 months ago
Merging #4192 (4b3df69) into master (bf0dbea) will increase coverage by
0.10%
. The diff coverage is100.00%
.
We seem not only to not catch traces during test teardown but not produce coverage either? The coverage part is probably ok, but not actually catching this KeyError in CI is odd.
Thanks for sending a PR!
PR Prelude
Thank you for working on YCM! :)
Please complete these steps and check these boxes (by putting an
x
inside the brackets) before filing your PR:Why this change is necessary and useful
First and more common error is that by the time we execute
the buffer might not be there any more. This is because
RangeVisibleInBuffer()
is called asynchronously and the user may bwipeout a buffer in between polls. This regularly happens in our vim tests. In such a case, we get a nasty traceback fromvimsupport
module. The solution is to catch the KeyError and return None.However,
ScrollingBufferRange()
also was not ready to handle None values fromRangeVisibleInBuffer()
, even thoughRangeVisibleInBuffer()
could return None even before, if a visible window forbufnr
can not be found.As for the missing tests... showing that an inherently racy scenario does not cause a stacktrace in vim level test... I think I prefer to keep what is left of my sanity.
This change is![Reviewable](https://reviewable.io/review_button.svg)