skillfed

pytest-testmon

selects tests affected by changed files and methods

pytest-testmon v2.2.0 4.8M downloads/30d#2,238 on PyPI
Permissive license MIT AGING released

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-testmon

uv

uv add pytest-testmon

poetry

poetry add pytest-testmon

Installing 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

Development Status :: 4 - BetaFramework :: PytestIntended Audience :: DevelopersOperating System :: MacOS :: MacOS XOperating System :: Microsoft :: WindowsOperating System :: POSIXProgramming Language :: PythonTopic :: Software Development :: LibrariesTopic :: Software Development :: TestingTopic :: Utilities

Tags

pytest affected testsselective test executiontest impact analysispytest dependency trackingincremental test runschanged code test selectionpytest test filtering
test-optimizationci-acceleration

More Libraries packages