pytest-snob
A pytest plugin that only selects meaningful python tests to run.
What it is and what it does
pytest-snob is a pytest plugin that integrates the snob static analysis library to filter which tests run based on the files changed in a commit range. Instead of running your entire test suite on every CI run, it analyzes your Python codebase's dependency graph to determine which tests could be affected by the changes, then runs only those. This saves time and resources by avoiding redundant test execution.
The plugin wraps snob, a Rust library compiled to Python via PyO3 and Maturin, which efficiently parses your project's import structure and tracks which modules depend on which files. You invoke it by passing commit ranges to pytest (e.g., `--commits origin/main..HEAD`), and it automatically selects the relevant test subset. It requires Python 3.9 or later and depends on pytest and snob_lib at runtime.
Use it for:
- Speed up CI pipelines by running only tests affected by pull request changes instead of the full suite.
- Reduce local development feedback time by running only tests impacted by your uncommitted changes.
- Validate that a hotfix to a single module doesn't break dependent code without re-running unrelated tests.
- Optimize resource usage in resource-constrained CI environments by skipping unnecessary test execution.
- Implement regression test selection in large monorepos where full test runs are prohibitively slow.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A pytest plugin that selects and runs only the tests affected by changes in a given commit range, using static dependency analysis to avoid unnecessary test execution.
Yes, if you have a substantial test suite and want to reduce CI time. The plugin is actively maintained, has no known vulnerabilities, installs with low friction, and solves a real problem—unnecessary test execution. The main caveat is ensuring snob_lib wheels are available for your platform; verify that before committing to it in your pipeline.
Install
pytest-snob on PyPI
pip
pip install pytest-snobuv
uv add pytest-snobpoetry
poetry add pytest-snobInstalling pytest-snob
Before you install
Low friction to install; the package is a pure Python wheel with only two runtime dependencies (snob_lib and pytest). Actively maintained with recent releases and no archived status.
License in practice
Licensed under MIT (permissive), so you can use, modify, and distribute the package freely with minimal legal constraints.
Quickstart
pip install pytest-snob
pytest --snob --commits origin/main..HEAD
Requires Python 3.9 or later; snob_lib is a compiled Rust extension, so installation depends on pre-built wheels for your platform.
Verify before relying
- Whether snob_lib wheels are available for all major platforms and Python versions you target.
- How the plugin handles monorepos or non-standard repository structures.
- Performance characteristics when analyzing large codebases with complex dependency graphs.
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — snob_lib, pytest |
| Maintenance | actively maintained — 579 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 92,881/month — #13,416 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pytest_snob-0.1.14-py3-none-any.whl
Keywords: snob, pytest, testing, rust, rts, maturin, pyo3
Tags
More Testing packages
Pluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
virtualenvvirtualenv creates isolated Python environments…
permissive · top 100 on PyPI
coverageCoverage.py measures which lines of Python code…
permissive · top 1,000 on PyPI
pytest-asynciopytest-asyncio is a pytest plugin that enables…
permissive · top 1,000 on PyPI
pytest-json-ctrfA pytest plugin that generates test reports in…
permissive · top 1,000 on PyPI
pytest-pickedA pytest plugin that automatically runs only…
permissive · top 5,000 on PyPI
pytest-testmonA pytest plugin that automatically identifies…
permissive · top 5,000 on PyPI
snob-libSnob analyzes your Python project's dependency…
permissive · top 15,000 on PyPI
pytest-filter-subpackageA pytest plugin that adds a `-P` option to run…
permissive · top 15,000 on PyPI
ignore-pythonProvides fast recursive directory traversal…
unclear · top 15,000 on PyPI
pytest-unused-fixturesA pytest plugin that identifies and reports…
permissive · top 15,000 on PyPI
pytest-incrementalpytest-incremental is a pytest plugin that…
permissive · top 15,000 on PyPI
pytest-cagouleA pytest plugin that identifies which tests…
permissive · top 15,000 on PyPI
maturin-import-hookAutomatically rebuilds Rust components in…
permissive · top 15,000 on PyPI
pytest-regexA pytest plugin that selects tests to run using…
permissive · top 15,000 on PyPI