A simple pytest plugin that will shrink pytest output when specified, to fit the vim quickfix window.
The vim quickfix window prepends ||
to commands output lines, to differentiate
from its actual fix elements. This behaviour is intended and not configurable.
Pytest default terminal reporter calculates the available terminal width and organize its layout accordingly, often printing characters to the far right of the screen.
When running pytest in vim (for example using pytest-vim-compiler inside vim-dispatch), its output in the quickfix window will show a broken layout (since there actually are fewer columns available than pytest calculated).
This issue is exacerbated if signcolumn
is set.
Pytest-vimqf simply trick pytest's terminal reporter in thinking the terminal is slightly smaller. This allows it to fit nicely in the vim quickfix window.
Install using pip:
# pip install pytest-vimqf
The plugin is disabled by default, allowing pytest to use the whole terminal when called normally.
From inside vim, simply add the flag --vim-quickfix
to pytest. For example:
:Dispatch pytest --vim-quickfix