Skip to main content

fzf-based test selector for pytest

Project description


PyPI version Python versions Tests

fzf-based test selection with pytest


(demo uses the gruvbox-dark pygments style)


  • Select tests to be run with pytest using fzf



You can install pytest-fzf via pip from PyPI:

pip install pytest-fzf


pytest --fzf [query]
pytest --fzf [--fzf-bat-preview] # uses bat as fzf preview command

Syntax highlighting theme

The theme used for previewing test functions can be set using PYTEST_FZF_THEME (or BAT_THEME, if you use bat, see sharkdp/bat):

export PYTEST_FZF_THEME='gruvbox-dark'

For a list of supported themes, see or get a list by running:

import pygments

for style in pygments.styles.get_all_styles():


The following keybindings can be used in the fzf selection menu

  • Tab: selected/deselect tests
  • Shift+Tab: selected/deselect tests (move up)
  • Ctrl+a: select/deselect all tests


Contributions are very welcome. Tests can be run with nox, please ensure the coverage at least stays the same before you submit a pull request.


Distributed under the terms of the GNU GPL v3.0 license, pytest-fzf is free and open source software


If you encounter any problems, please file an issue along with a detailed description.

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-fzf-0.1.0.tar.gz (24.6 kB view hashes)

Uploaded Source

Built Distribution

pytest_fzf-0.1.0-py3-none-any.whl (18.6 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