pytest-testmon
selects tests affected by changed files and methods
What it is and what it does
pytest-testmon is a pytest plugin that tracks dependencies between your code and tests, then uses that information to run only the tests affected by your recent changes. Instead of running your entire test suite after every edit, it builds a dependency database on first run and then intelligently selects which tests to execute based on what code you've modified.
The plugin depends on pytest and coverage to work. It's designed for developers who want faster feedback loops during development by skipping tests that cannot possibly be affected by their changes. The approach trades a small upfront cost (building the dependency map) for potentially significant time savings on subsequent runs, especially in large projects.
Use it for:
- Speed up development feedback by running only tests affected by your current changes instead of the full suite.
- Integrate into CI pipelines to reduce test execution time on pull requests with localized code changes.
- Validate that refactoring or bug fixes don't break unrelated functionality by confirming only relevant tests are affected.
- Reduce developer wait time in large codebases where full test runs take minutes or longer.
- Detect unexpected test dependencies by observing which tests are marked as affected by a given code change.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A pytest plugin that automatically identifies and runs only the tests affected by recent code changes, using dependency tracking to avoid re-running unrelated tests.
Yes, if you have a large test suite and want faster development feedback. The low install friction and permissive license make it a low-risk experiment. However, the aging maintenance status (256 days since last release) means you should verify reliability in your codebase before relying on it in critical CI workflows, and be prepared to maintain or fork it if issues arise.
Install
pytest-testmon on PyPI
pip
pip install pytest-testmonuv
uv add pytest-testmonpoetry
poetry add pytest-testmonInstalling pytest-testmon
Before you install
Low friction install with just pytest and coverage as dependencies. Maintenance status is aging—last release was 256 days ago—so updates and bug fixes may be slower than actively maintained alternatives.
License in practice
MIT license is permissive, allowing use in both open-source and proprietary projects with minimal restrictions.
Quickstart
pip install pytest-testmon
# First run: build dependency database
pytest --testmon
# Subsequent runs: only affected tests execute
pytest --testmon
Requires Python >=3.10.
Verify before relying
- Reliability of affected-test detection in complex codebases with dynamic imports or metaprogramming.
- Performance overhead of building and maintaining the dependency database on large test suites.
- Compatibility with pytest plugins that modify test collection or execution.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — pytest, coverage |
| Maintenance | aging — 256 days since the last release |
| First released | |
| Downloads | 4,761,816/month — #2,238 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pytest_testmon-2.2.0-py3-none-any.whl
Keywords: testing, pytest, plugin
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
pytest-incrementalpytest-incremental is a pytest plugin that…
permissive · top 15,000 on PyPI
pytest-snobA pytest plugin that selects and runs only the…
permissive · top 15,000 on PyPI
pytest-skip-slowA pytest plugin that skips tests marked with…
permissive · top 15,000 on PyPI
snob-libSnob analyzes your Python project's dependency…
permissive · top 15,000 on PyPI
pytest-memrayA pytest plugin that integrates memray memory…
permissive · top 5,000 on PyPI
pytest-filter-subpackageA pytest plugin that adds a `-P` option to run…
permissive · top 15,000 on PyPI
pytest-cacheA pytest plugin that persists test state across…
permissive · top 15,000 on PyPI
pytest-cagouleA pytest plugin that identifies which tests…
permissive · top 15,000 on PyPI
pytest-pickedA pytest plugin that automatically runs only…
permissive · top 5,000 on PyPI
pytest-json-reportA pytest plugin that generates JSON-formatted…
permissive · top 5,000 on PyPI