Skip to main content

A simple pytest plugin that will shrink pytest output when specified, to fit vim quickfix window.

Project description

GitHub Workflow Status PyPI PyPI - Python Version Build system: poetry

A simple pytest plugin that will shrink pytest output when specified, to fit the vim quickfix window.

The problem

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.

The solution

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

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytest_vimqf-0.8.1.tar.gz (15.0 kB view hashes)

Uploaded Source

Built Distribution

pytest_vimqf-0.8.1-py3-none-any.whl (15.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page