Nifty pytest
A pytest test explorer with saved run configurations, marker filters, real assertion diffs, rerun-failed and slowest-test reports.
Maintained. No sign-in. No telemetry. Works in VS Code, Cursor, Windsurf, VSCodium and other editors that use Open VSX.
Features


- Your pytest suite in the Test Explorer. Files, classes, tests and every parametrized case, with run buttons in the gutter and each test's markers (
@slow, @db) shown next to it. Discovery uses pytest itself, so conftest.py, plugins and pytest.ini / pyproject.toml settings all apply.
- Assertion diffs that are actually readable. When
assert result == expected fails, the failure opens VS Code's side-by-side diff of the two values, pretty-printed, not a wall of E lines.
- Saved run configurations. Define "Fast", "Integration only" or "With coverage" once in settings and pick them from the Run and Debug dropdowns. Each has its own arguments and environment variables.
- Marker and keyword runs. Run Tests with Marker… lists the markers used in your suite (and their
not versions). Run Tests Matching… runs a -k expression.
- Rerun Failed Tests in one click from the Test Explorer toolbar.
- Show Slowest Tests from the last run, and jump straight to them.
- Debug any test with the Python Debugger, including through a saved configuration.
- Setup and teardown errors are shown as errors, skips and xfails as skipped, and each test's captured output is attached to it.
- Uses your interpreter: the one selected in the Python extension (venv, conda, uv, Poetry), or
nifty.pytest.pythonPath.
Example configuration
// .vscode/settings.json
"nifty.pytest.configurations": [
{ "name": "Fast", "args": ["-m", "not slow", "-x"] },
{ "name": "Integration", "args": ["-m", "integration"], "env": { "DATABASE_URL": "postgres://localhost/test" } }
]
Commands
| Command |
What it does |
Nifty pytest: Refresh Tests |
Rediscover tests |
Nifty pytest: Run All Tests |
Run the whole suite |
Nifty pytest: Run Tests with Marker… |
Run tests selected by a marker expression (-m) |
Nifty pytest: Run Tests Matching (-k)… |
Run tests whose names match a keyword expression |
Nifty pytest: Rerun Failed Tests |
Run only the tests that failed last time |
Nifty pytest: Show Slowest Tests |
The slowest tests of the last run |
Nifty pytest: Add Run Configuration… |
Save a named set of pytest arguments |
Settings
| Setting |
Default |
What it does |
nifty.pytest.pythonPath |
"" |
Interpreter with pytest installed. Empty uses the Python extension's selection |
nifty.pytest.args |
[] |
Arguments added to every run and discovery |
nifty.pytest.env |
{} |
Environment variables for every run |
nifty.pytest.configurations |
[] |
Saved run configurations (see above) |
nifty.pytest.autoDiscover |
true |
Discover tests on startup and when test files change |
Using it alongside the Python extension
Microsoft's Python extension also lists pytest tests. To avoid seeing each test twice, turn its runner off with "python.testing.pytestEnabled": false in the workspace, or hide one of the two in the Test Explorer's filter.
Install
- VS Code: search for "Nifty pytest" in the Extensions view, or install from the Visual Studio Marketplace.
- Cursor, Windsurf, VSCodium, Kiro, Antigravity: install from Open VSX.
Privacy
This extension collects no telemetry and needs no account.
- Nifty Python Profiler: cProfile Hotspots Inline: Profile Python scripts and pytest runs with cProfile: hotspot table, call counts and timings inline next to each function. (Open VSX)
- Nifty Code Runner: Run Code in 25+ Languages: Run the current file or selection in 25+ languages in the terminal, with input support, your own commands and no telemetry. (Open VSX)
- Nifty Env: .env Files, Profiles & Secrets: Load .env files into terminals, tasks and debug sessions, switch between .env profiles, hide secret values on screen, and check .env against .env.example. (Open VSX)
- Nifty Launch: launch.json Generator & Checker: Add debug configurations for what's in your project (npm scripts, tests, Python, Django, FastAPI, Go, .NET, Rust, browsers), build compounds, and catch broken launch.json references. (Open VSX)
- Nifty Python Envs: venv, uv, conda & pyenv: See and manage every Python environment: project venvs (uv or venv), uv-managed Pythons, conda and pyenv. Create, activate in terminals, pick for the workspace, and manage packages. (Open VSX)
- Nifty REST Client: .http Files & HTTP Requests: Send HTTP requests from .http files: variables, environments, request chaining, response viewer, cURL import and export, and history. No account, no cloud. (Open VSX)
See all 100+ Nifty extensions and web tools at https://getnifty.dev
| |