I have installed vim-test, and setup the following pytest executable in my .vimrc
:
let g:test#python#pytest#executable = 'python3 -m pytest'
When I call :TestFile
, pytest runs in a background shell and display errors. But I would like to display those errors with file names and line numbers in a quick fix window that can be used to jump to the file at that line number.
The vim test readme mentions several quickfix-strategies:
https://github.com/vim-test/vim-test#quickfix-strategies
Is there a way to simply display the errors in a quickfix window, without creating a makefile?
let test#strategy = "dispatch"
to.vimrc
so that the test output appears in a vim split (usingtpope/vim-dispatch
). But it still doesn't provide the link to jump to line numbers within files.let test#strategy = "make"
does create a link to the particular line in the file, but the split disappears when pressing enter on that file & line number. I am used to a quick fix window, for example when calling ":Git grep", files and line numbers are display and remain after clicking on them.:copen
after one of those strategies. There are also a few commands (cbuffer?) that can create a quickfix list from arbitrary buffers/files/expressions