fzf-based test selector for pytest
Project description
pytest-fzf
fzf-based test selection with pytest
(demo uses the gruvbox-dark pygments style)
Features
- Select tests to be run with pytest using fzf
Requirements
Installation
You can install pytest-fzf
via pip
from PyPI:
pip install pytest-fzf
Usage
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 https://pygments.org/styles/ or get a list by running:
import pygments
for style in pygments.styles.get_all_styles():
print(style)
Keybindings
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
Contributing
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.
License
Distributed under the terms of the GNU GPL
v3.0 license, pytest-fzf
is free and open source software
Issues
If you encounter any problems, please file an issue along with a detailed description.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pytest_fzf-0.1.1.tar.gz
.
File metadata
- Download URL: pytest_fzf-0.1.1.tar.gz
- Upload date:
- Size: 24.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 58d8cef0505e9276af57620c3098aa2f88845055e203935e986a47f02e48541d |
|
MD5 | 32414d690e49039cba3ebe2022be8f7a |
|
BLAKE2b-256 | 0950fc3d6cf448ff00ad7a45a068b113a7cc198b4a5aeca0fcc48c1f903ed6d7 |
File details
Details for the file pytest_fzf-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: pytest_fzf-0.1.1-py3-none-any.whl
- Upload date:
- Size: 18.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3b0d68936799a1eb0ee402a5d6e3117fd0cdee292f06f7689fb104c87d8c01e4 |
|
MD5 | 2180b23971dcd8cd0c7284a79ace1314 |
|
BLAKE2b-256 | c4dba641e67b2a4188b6dc49c3511b2069be187fda395c19d80a713efb23ffb6 |