A pytest plugin which makes --last-failed skip instead of deselect tests.
I made this plugin to resolve a small but annoying-enough issue that I encountered in VS Code where the test panel would not show all of my tests when I had the --last-failed option enabled for pytest, due to the previously passed tests being deselected instead of skipped.
You can install pytest-lf-skip from pip:
pip install pytest-lf-skipJust add the --lf-skip or --last-failed-skip argument to your pytest command when you use --last-failed:
pytest --last-failed --last-failed-skipNow previously passed tests will be skipped instead of being deselected.
If you are using VS Code, you can make use of the --auto-last-failed-skip-vscode argument, which will automatically enable --lf and --lf-skip when running tests from the VS Code test explorer.
To enable this, add the following to your settings.json:
{
"python.testing.pytestArgs": [
"--auto-last-failed-skip-vscode",
]
}