--- id: pytest-snob version: "0.1.14" license: unclear license_treatment: permissive maintenance: active --- # pytest-snob — A pytest plugin that only selects meaningful python tests to run. License: permissive · Maintenance: active · Downloads: 92.9K/mo ## 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 above — 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 pip install pytest-snob uv add pytest-snob poetry add pytest-snob ## Installing 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_current - Install friction: low - Maintenance: active - Downloads: 92.9K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags pytest selective test running, run only affected tests, test impact analysis, commit-based test filtering, reduced test suite execution, dependency graph test selection, rts pytest plugin, test-optimization, ci-acceleration, rust-extension [View on SkillFed](https://skillfed.io/packages/pytest-snob) · [View on PyPI](https://pypi.org/project/pytest-snob/)