TL;DR https://github.com/ddoroshev/pytest.fish
Typing repetitive commands or copying and pasting test names can eat up valuable time. To help, I've created pytest.fish - a Fish shell plugin that simplifies your pytest workflow. It's lightweight, simple to set up, and makes testing more efficient.
Type pytest and hit TAB to get suggestions for test paths and functions:
Narrow down tests with -k and get name suggestions:
The plugin dynamically scans your project, so suggestions stay up-to-date.
Install with Fisher:
fisher install ddoroshev/pytest.fish
Or manually copy the files from the repository into your Fish configuration.
The plugin doesn't rely on pytest directly (yet). Instead, it scans the current directory for test files and searches for test functions inside them, making the process relatively fast and efficient.
Since I primarily use Fish in my local development environment, I created a plugin specifically for this shell. However, if you use Bash or Zsh, feel free to create your own - or switch to Fish already. ?
The above is the detailed content of Pytest Fish shell autocompletion. For more information, please follow other related articles on the PHP Chinese website!