Plugin spotlight – vim-test

This is the most popular test runner, as it provides a set of compilers (as well as handy mappings) for plugging into a lot of test runners. For Python, vim-test supports djangotest, django-nose, nose, nose2, pytest, and PyUnit. It's available from https://github.com/janko-m/vim-test. You'll have to make sure you have the desired test runner already installed before using vim-test.

If you're using vim-plug, you can install vim-test by adding Plug 'janko-m/vim-test' to your .vimrc file and running :w | source $MYVIMRC | PlugInstall.

vim-test supports the following commands:

  • :TestNearest runs the test nearest to the cursor
  • :TestFile runs the tests in the current file
  • :TestSuite runs the entire test suite
  • :TestLast runs the last test

vim-test also allows you to specify test strategy, as in, what method to use for running tests. Strategies such as make, neomake, MakeGreen, and dispatch (or dispatch_background) populate a quickfix window, which is exactly what you'd be looking for in a plugin like this.

For example, if you wanted to run your tests through vim-dispatch (to run a test in a different Terminal window, for instance), you would add the following to your .vimrc file:

let test#strategy = "dispatch"

You can visit https://github.com/janko-m/vim-test for more information about vim-test.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.158.47