neovim / pynvim

Python client and plugin host for Nvim
http://pynvim.readthedocs.io/en/latest/
Apache License 2.0
1.47k stars 118 forks source link

test_buffer: don't depend on version-dependent default values of 'define' #531

Closed michel-slm closed 11 months ago

michel-slm commented 11 months ago

test_options has an assertion that tests whether setting a local value modifies the global value, but tests it against a hardcoded constant.

This constant changed in https://github.com/neovim/neovim/commit/fcfe535e9877cfdc824dc78f2d19e590400d34cd

and https://github.com/neovim/pynvim/commit/82a2e14b96fbffa30caeefec6e86b668c96662eb fixes it by using the new constant instead, but this causes tests to fail against even the latest released version of neovim.

To make this version-agnostic, save the old global value, and assert that the new value is equal after setting the local value.