--- id: pytest-watcher version: "0.6.3" license: MIT license_treatment: permissive maintenance: aging --- # pytest-watcher — Automatically rerun your tests on file modifications License: permissive · Maintenance: aging · Downloads: 1.8M/mo ## What it is and what it does pytest-watcher is a command-line tool that monitors your Python project for file changes and automatically reruns your tests. It watches for new, modified, deleted, or moved .py files by default, though you can customize the patterns. The tool uses native system file monitoring APIs (via watchdog) instead of polling, making it efficient on supported platforms including Unix and Windows. You run it with `ptw .` to watch your current directory, and it passes any additional arguments to pytest or your chosen test runner. It includes a configurable delay (default 0.2 seconds) to account for post-processors like code formatters, optional screen clearing, and terminal notifications on test failure. Configuration can be set in pyproject.toml, and it requires Python 3.9 or later. Use it for: - Rapid feedback loop during test-driven development where you want tests to run immediately after saving code - Continuous validation of a specific directory or file pattern while refactoring - Running alternative test runners with the same watch-and-rerun workflow - Ignoring certain files while watching the rest of your codebase ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Automatically reruns pytest (or another test runner) whenever your Python code changes, using native system file monitoring on supported platforms. Yes, if you want a lightweight, low-friction way to automatically rerun tests during development. The aging maintenance status (last release 216 days ago) means you should not expect rapid bug fixes, but the package is stable and has no known vulnerabilities. Install it for active development workflows where continuous test feedback is valuable. ## Install pip install pytest-watcher uv add pytest-watcher poetry add pytest-watcher ## Installing pytest-watcher Before you install: Low install friction with only two runtime dependencies (tomli and watchdog). Maintenance status is aging—last release was 216 days ago—so expect slower response to issues, though the package is stable enough for established workflows. License in practice: MIT license permits unrestricted use, modification, and distribution with minimal legal friction. Quickstart: pip install pytest-watcher ptw . Requires Python 3.9 or later Verify before relying: - Whether interactive mode keyboard shortcuts work reliably on all POSIX systems - Performance characteristics when watching large codebases or many file patterns simultaneously - Compatibility with test runners other than pytest ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: aging - Downloads: 1.8M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags auto-rerun tests on file change, pytest watch file changes, continuous test runner, test watcher tool, pytest auto-rerun, test-automation, file-watcher, dev-tools [View on SkillFed](https://skillfed.io/packages/pytest-watcher) · [View on PyPI](https://pypi.org/project/pytest-watcher/)